require "Dialogs"

Encounter.Call("ContinueMusic")
Arena.Resize(250, 130)
Player.SetControlOverride(true)

state = 1
maxjump = 40
jump = 0
newpX = Player.absx
newpY = Player.absy
tableaux = 0

pudinTimer = 0 --En memoria a mi compañero Pinzón / In memory of my buddy Pinzón XDXDDDD
shake = {}
phases = {0, 0}
Paps = {X = 240, Y = 240}
Sans = {X = 410, Y = 261}

GB = {}
Bones = {}
Platforms = {}
Warns = {}
Bones2 = {}
Shatter = {}
Confetti = {}
Shards = {}

if Encounter["Sans"]["Animation"] == "Right" then
	pudinTimer = -2
end

SetPPCollision(true)

function RecolorSoul()
	if state == 1 or state == 2 or state == 8 then
		Player.sprite.color = {0,60/255,1}
		Player.sprite.rotation = 0
	elseif state == 3 or state == 5 or state == 7 then
		Player.sprite.color = {0,60/255,1}
		Player.sprite.rotation = 270
	elseif state == 4 or state == 6 then
		Player.sprite.color = {0,60/255,1}
		Player.sprite.rotation = 90
	else
		Player.sprite.color = {1.0,0.0,0.0}
		Player.sprite.rotation = 0
	end
end

RecolorSoul()

function Update()
	DialogUpdate()
	SongTime = NewAudio.GetPlayTime("One")
	if pudinTimer == -2 then
		if GetAlMightyGlobal("Idioma") == "Spanish" then
			Bubble("[noskip][font:sans][voice:sans][func:SetSansHead,Wink]gracias chico[w:10], lo\nguardaré para más\ntarde.", "leftwide", 230.5, 335, 10, 90, 1)
		else
			Bubble("[noskip][font:sans][voice:sans][func:SetSansHead,Wink]thanks kiddo[w:10], i will save\nit for later.", "leftwide", 230.5, 335, 10, 90, 1)
		end
		pudinTimer = -1
	elseif pudinTimer == -1 and Bubbles[1] and not Bubbles[1].Activo then
		pudinTimer = 1
		Encounter["Sans"]["Animation"] = "Normal"
		Encounter.Call("SetSansHead","Normal")
		Encounter["Ketchup"].Remove()
		Encounter["Ketchup"] = nil
	elseif pudinTimer >= 0 and pudinTimer < 30 then
		pudinTimer = pudinTimer + 1
		Paps.X = 285 - 45*math.cos(math.rad(180/30*pudinTimer))
		Sans.X = 450 - 40*math.cos(math.rad(180/30*pudinTimer))
		Encounter.Call("SansAlpha", 0.75 + 0.25*math.cos(math.rad(180/30*pudinTimer)))
	elseif pudinTimer == 30 then
		if Encounter["StatusPhase3"][2] == "Check Papyrus" then
			if Encounter["StatusPhase3"][1] == "Check Papyrus" then
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:papyrus][voice:papyrus]Seguro que te\ngusta checarme.", "leftwide", 156.5, 395, 10, 90, 1)
				else
					Bubble("[noskip][font:papyrus][voice:papyrus]You sure like to\ncheck me.", "leftwide", 156.5, 395, 10, 90, 1)
				end
			else
				Encounter.Call("AttackAnim", 2)
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:papyrus][voice:papyrus]NYEHEHEHEHEH![w:10][func:AttackAnim,2]\nSorprendido?", "leftwide", 156.5, 395, 10, 90, 1)
				else
					Bubble("[noskip][font:papyrus][voice:papyrus]NYEHEHEHEHEH![w:10][func:AttackAnim,2]\nSurprised?", "leftwide", 156.5, 395, 10, 90, 1)
				end
			end
		elseif Encounter["StatusPhase3"][2] == "Check Sans" then
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]Nunca pensé que\nsabías cómo\npelear Sans.", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]I never thought\nyou knew how to\nfight Sans.", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Flirt" then
			if Encounter["StatusPhase3"][1] == "Flirt" then
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:papyrus][voice:papyrus]Qué diabls te\npasa humano?!", "leftwide", 156.5, 395, 10, 90, 1)
				else
					Bubble("[noskip][font:papyrus][voice:papyrus]What the heck is\nwrong with you\nhuman?!", "leftwide", 156.5, 395, 10, 90, 1)
				end
			else
				Encounter.Call("SetSansHead", "Worried")
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:papyrus][voice:papyrus]No sé qué\nintentas hacer\nCoqueteando\nconmigo.", "leftwide", 156.5, 395, 10, 90, 1)
				else
					Bubble("[noskip][font:papyrus][voice:papyrus]I don't know what\nare you trying to\ndo Flirting with\nme.", "leftwide", 156.5, 395, 10, 90, 1)
				end
			end
		elseif Encounter["StatusPhase3"][2] == "Cry" then
			if Encounter["StatusPhase3"][1] == "Fight Papyrus" or Encounter["StatusPhase3"][1] == "Cry" then
				Encounter.Call("SetHead","Disgust")
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:papyrus][voice:papyrus]VAMOS AHORA...", "leftwide", 156.5, 395, 10, 90, 1)
				else
					Bubble("[noskip][font:papyrus][voice:papyrus]COME ON NOW...", "leftwide", 156.5, 395, 10, 90, 1)
				end
			else
				Encounter.Call("SetHead","Sad")
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:papyrus][voice:papyrus]Creo que...", "leftwide", 156.5, 395, 10, 90, 1)
				else
					Bubble("[noskip][font:papyrus][voice:papyrus]I think...", "leftwide", 156.5, 395, 10, 90, 1)
				end
			end
		elseif Encounter["StatusPhase3"][2] == "Pun" then
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]Por favor no me\nasustes así.", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]Please don't\nscare me like\nthat.", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Kick" then
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]SANS[w:10], puedes\ndejar esa botella\ny concentrarte\nen la pelea?!", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]SANS[w:10], can you\nstop with that\nbottle and focus\non the battle?!", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Fight Papyrus" then
			if Encounter["StatusPhase3"][1] == "Miss Papyrus" then
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:papyrus][voice:papyrus]Pensé que\nvolverías a\nfallar como hace\nun momento.", "leftwide", 156.5, 395, 10, 90, 1)
				else
					Bubble("[noskip][font:papyrus][voice:papyrus]I thought you\nwould miss again\nlike you did\nbefore.", "leftwide", 156.5, 395, 10, 90, 1)
				end
			else
				Encounter.Call("AttackAnim", 2)
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:papyrus][voice:papyrus]NYEHEHEHEHEH![w:10][func:AttackAnim,2]\nAtacame todas\nlas veces que\nquieras.", "leftwide", 156.5, 395, 10, 90, 1)
				else
					Bubble("[noskip][font:papyrus][voice:papyrus]NYEHEHEHEHEH![w:10][func:AttackAnim,2]\nAttack me all\nthe times you\nwant.", "leftwide", 156.5, 395, 10, 90, 1)
				end
			end
		elseif Encounter["StatusPhase3"][2] == "Fight Sans" then
			if Encounter["FUN"][1] == "Rare" and Encounter["FUN"][2] == 2 then
				Encounter.Call("SetHead","Angry")
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:papyrus][voice:papyrus]SANS![w:10] ODIO CUANDO\nHACES ESE TIPO DE\nBROMAS!", "leftwide", 156.5, 395, 10, 90, 1)
				else
					Bubble("[noskip][font:papyrus][voice:papyrus]SANS![w:10] I HATE WHEN\nYOU DO THOSE KIND\nOF JOKES!", "leftwide", 156.5, 395, 10, 90, 1)
				end
			else
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:papyrus][voice:papyrus]Pensé que te\nlastimarías sans.", "leftwide", 156.5, 395, 10, 90, 1)
				else
					Bubble("[noskip][font:papyrus][voice:papyrus]I thought you\nwould get hurt\nsans.", "leftwide", 156.5, 395, 10, 90, 1)
				end
			end
		elseif Encounter["StatusPhase3"][2] == "Miss Papyrus" then
			Encounter.Call("SetHead","Disgust")
			Encounter.Call("AttackAnim", 1)
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]Estás tratando\nde hacer algo\nhumano?", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]Are you trying\nto do something\nhuman?", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Miss Sans" then
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]Estás tratando\nde hacer algo\nhumano?", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]Are you trying\nto do something\nhuman?", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Item" then
			Encounter.Call("AttackAnim", 2)
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]NYEHEHEHEHEH[w:10][func:AttackAnim,2]\nSeguro que te\ngusta mi espagueti[w:10],\nno es así?", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]NYEHEHEHEHEH[w:10][func:AttackAnim,2]\nYou sure like my\nspaghetti[w:10], don't\nyou?", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Spare" then
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]Espera[w:10], en serio?[w:10]\nnos acabas de\n[color:f2c900]perdonar[color:000000]?!", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]Wait[w:10], are you\nserious?[w:10] did you\njust [color:f2c900]spare[color:000000] us?!", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Flee" then
			Encounter.Call("SetHead","Disgust")
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]Que grosero de\nti humano.", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]How rude of you\nhuman.", "leftwide", 156.5, 395, 10, 90, 1)
			end
		end
		pudinTimer = 31
	elseif pudinTimer == 31 and Bubbles[1] and not Bubbles[1].Activo then
		if Encounter["StatusPhase3"][2] == "Check Papyrus" then
			if Encounter["StatusPhase3"][1] == "Check Papyrus" then
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:papyrus][voice:papyrus]Es la segunda\nvez consecutiva\nque lo haces.", "leftwide", 156.5, 395, 10, 90, 1)
				else
					Bubble("[noskip][font:papyrus][voice:papyrus]It's the second\ntime in a row you\ndo it.", "leftwide", 156.5, 395, 10, 90, 1)
				end
			else
				Encounter.Call("SetHead","Happy")
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:papyrus][voice:papyrus]Ahora ni siquiera\npuedes tocarme.", "leftwide", 156.5, 395, 10, 90, 1)
				else
					Bubble("[noskip][font:papyrus][voice:papyrus]Now you can't\neven touch me.", "leftwide", 156.5, 395, 10, 90, 1)
				end
			end
		elseif Encounter["StatusPhase3"][2] == "Check Sans" then
			Encounter.Call("SetSansHead","Joking")
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:sans][voice:sans]si[w:10], soy una [func:SetHead,Disgust][func:AttackAnim,1][color:ff0000]sans[w:5]-acion[color:000000].", "leftwide", 310.5, 335, 10, 90, 1)
			else
				Bubble("[noskip][font:sans][voice:sans]yeah[w:10], i'm a [func:SetHead,Disgust][func:AttackAnim,1][color:ff0000]sans[w:5]-ation[color:000000].", "leftwide", 310.5, 335, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Flirt" then
			if Encounter["StatusPhase3"][1] == "Flirt" then
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:papyrus][voice:papyrus]si esto es una\nbroma[w:10], exijo que te\ndetengas ahora\nmismo.", "leftwide", 156.5, 395, 10, 90, 1)
				else
					Bubble("[noskip][font:papyrus][voice:papyrus]If this is a joke[w:10],\nI demand you to\nstop this right\nnow.", "leftwide", 156.5, 395, 10, 90, 1)
				end
			else
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:papyrus][voice:papyrus]Pero este\nesqueleto no\nestá disponible.", "leftwide", 156.5, 395, 10, 90, 1)
				else
					Bubble("[noskip][font:papyrus][voice:papyrus]But this skeleton\nis not available.", "leftwide", 156.5, 395, 10, 90, 1)
				end
			end
		elseif Encounter["StatusPhase3"][2] == "Cry" then
			if Encounter["StatusPhase3"][1] == "Fight Papyrus" or Encounter["StatusPhase3"][1] == "Cry" then
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:papyrus][voice:papyrus]Si todo lo que\nvas a hacer es\nllorar.", "leftwide", 156.5, 395, 10, 90, 1)
				else
					Bubble("[noskip][font:papyrus][voice:papyrus]If all you're\ngonna do is cry.", "leftwide", 156.5, 395, 10, 90, 1)
				end
			else
				Encounter.Call("SetHead","Disgust")
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:papyrus][voice:papyrus]Es suficiente.[w:10][func:SetHead,Happy]\nEl humano ha ca-[next] ", "leftwide", 156.5, 395, 10, 90, 1)
				else
					Bubble("[noskip][font:papyrus][voice:papyrus]That's enough.[w:10][func:SetHead,Happy]\nThe human ha-[next] ", "leftwide", 156.5, 395, 10, 90, 1)
				end
			end
		elseif Encounter["StatusPhase3"][2] == "Pun" then
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]Parecía que\nquerías escuchar\nuna broma.", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]You looked like\nyou wanted to\nhear a pun.", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Kick" then
			Encounter.Call("SetSansHead","zzz")
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:sans][voice:sans]lo siento hermano[w:10][func:SetSansHead,Normal], solo\nque necesito toda mi\nenergía para asegurar\nque el humano aprenda.", "leftwide", 310.5, 335, 10, 90, 1)
			else
				Bubble("[noskip][font:sans][voice:sans]sorry bro[w:10][func:SetSansHead,Normal], i just need\nall my energy to make\nsure the human learns\ntheir lesson.", "leftwide", 310.5, 335, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Fight Papyrus" then
			if Encounter["StatusPhase3"][1] == "Miss Papyrus" then
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:papyrus][voice:papyrus]Pero no importa[w:10],\nno me vencerás\ncon ese ataque\ndébil.", "leftwide", 156.5, 395, 10, 90, 1)
				else
					Bubble("[noskip][font:papyrus][voice:papyrus]But it doesn't\nmatter[w:10], you won't\ndefeat me with\nthat weak attack.", "leftwide", 156.5, 395, 10, 90, 1)
				end
			else
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:papyrus][voice:papyrus]No me vencerás\ncon ese ataque\ndébil.", "leftwide", 156.5, 395, 10, 90, 1)
				else
					Bubble("[noskip][font:papyrus][voice:papyrus]You won't defeat\nme with those\nweak attacks.", "leftwide", 156.5, 395, 10, 90, 1)
				end
			end
		elseif Encounter["StatusPhase3"][2] == "Fight Sans" then
			if Encounter["FUN"][1] == "Rare" and Encounter["FUN"][2] == 2 then
				Encounter.Call("SetSansHead","Funny")
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:sans][voice:sans]lo siento papyrus[w:10], pero\nnece[next]sitaba hacer eso.", "leftwide", 310.5, 335, 10, 90, 1)
				else
					Bubble("[noskip][font:sans][voice:sans]sorry papyrus[w:10], but i\nne[next]eded to do that.", "leftwide", 310.5, 335, 10, 90, 1)
				end
			else
				Encounter.Call("SetSansHead","Wink")
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:sans][voice:sans]buen intento chico[w:10][func:SetSansHead,Normal], pero\nni siquiera estabas cerca\nde golpearme hehehe.", "leftwide", 310.5, 335, 10, 90, 1)
				else
					Bubble("[noskip][font:sans][voice:sans]nice try kid[w:10][func:SetSansHead,Normal], but you\nweren't even close to\nhitting me hehehe.", "leftwide", 310.5, 335, 10, 90, 1)
				end
			end
		elseif Encounter["StatusPhase3"][2] == "Miss Papyrus" then
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]Veo que estás\nfallando tus\nataques.", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]I see you are\nfailing your\nattacks.", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Miss Sans" then
			Encounter.Call("SetSansHead","Joking")
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:sans][voice:sans]ni necesité esquivar\nhehehe[w:10][func:SetSansHead,Normal], acaso el [func:SetSansHead,Joking][color:ff0000]esqueleto[color:000000]\nte quitó el [func:SetSansHead,Wink][color:ff0000]alma[color:000000]?", "leftwide", 310.5, 335, 10, 90, 1)
			else
				Bubble("[noskip][font:sans][voice:sans]i didn't need to dodge\nhehehe[w:10][func:SetSansHead,Normal], did the [func:SetSansHead,Joking][color:ff0000]skeleton[color:000000]\ntook your [func:SetSansHead,Wink][color:ff0000]soul[color:000000]?", "leftwide", 310.5, 335, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Item" then
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]Después de todo\nfue hecho por mí[w:10],\nel GRAN PAPYRUS!!", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]After all it was\nmade by me[w:10], the\nGREAT PAPYRUS!!", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Spare" then
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:sans][voice:sans]sip papyrus[w:10], el chico\nnos [color:f2c900]perdonó[color:000000].", "leftwide", 310.5, 335, 10, 90, 1)
			else
				Bubble("[noskip][font:sans][voice:sans]yup papyrus[w:10], this kiddo\njust [color:f2c900]spared[color:000000] us.", "leftwide", 310.5, 335, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Flee" then
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]Solo estamos\ntratando de\nhacerte una\nbuena persona.", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]We are just\ntrying to make\nyou a good\nperson.", "leftwide", 156.5, 395, 10, 90, 1)
			end
		end
		pudinTimer = 32
	elseif pudinTimer == 32 and Bubbles[1] and not Bubbles[1].Activo then
		if Encounter["StatusPhase3"][2] == "Check Papyrus" then
			Encounter.Call("SetHead","Thinking")
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]Casi siento que\nsoy el centro de\natención.", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]It almost feels\nlike I'm the center\nof attention.", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Check Sans" then
			Encounter.Call("SetSansHead","Normal")
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]Tienes que hacer\nuna broma cada\nvez que hablas?", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]You have to make\na pun everytime\nyou talk?", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Flirt" then
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:sans][voice:sans]aww[w:10], vamos papyrus.[w:10]\nSolo está intentando\nllegar a tu [func:SetSansHead,Joking][func:AttackAnim,1][color:ff0000]corazón\nesquelético[color:000000].[w:5][next] ", "leftwide", 310.5, 335, 10, 90, 1)
			else
				Bubble("[noskip][font:sans][voice:sans]aww[w:10], come on papyrus.[w:10]\nThey are just trying\nto get to your [func:SetSansHead,Joking][func:AttackAnim,1][color:ff0000]skeletic\nheart[color:000000].[w:5][next] ", "leftwide", 310.5, 335, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Cry" then
			if Encounter["StatusPhase3"][1] == "Fight Papyrus" or Encounter["StatusPhase3"][1] == "Cry" then
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:papyrus][voice:papyrus]Entonces me voy\nhasta que dejes\nde llorar.", "leftwide", 156.5, 395, 10, 90, 1)
				else
					Bubble("[noskip][font:papyrus][voice:papyrus]Then I'm leaving\nuntil you stop\ncrying.", "leftwide", 156.5, 395, 10, 90, 1)
				end
			else
				Encounter.Call("SetHead","Disgust")
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:sans][voice:sans]espera papyrus[w:10], esa cara[w:10],\nesa es la cara de un\n[func:SetHead,Happy][color:ff0000]mal mentiroso[color:000000].", "leftwide", 310.5, 335, 10, 90, 1)
				else
					Bubble("[noskip][font:sans][voice:sans]wait papyrus[w:10], that face[w:10],\nthat's a face of a [func:SetHead,Happy][color:ff0000]bad\nlier[color:000000].", "leftwide", 310.5, 335, 10, 90, 1)
				end
			end
		elseif Encounter["StatusPhase3"][2] == "Pun" then
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]O que querías\nintentar hacer\nuno tú mismo.", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]Or wanted to\ntry making one\nyourself.", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Kick" then
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]Bueno[w:10], ahora que\nestás con toda\ntu energía.", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]Well[w:10], now that\nyou are with full\nenergy.", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Fight Papyrus" then
			Encounter.Call("SetSansHead", "Joking")
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:sans][voice:sans]a menos que te den un\n[func:AttackAnim,1][color:ff0000]crucigrama[color:000000][w:10][func:SetSansHead,Normal], verdad chico?", "leftwide", 310.5, 335, 10, 90, 1)
			else
				Bubble("[noskip][font:sans][voice:sans]unless they give you a\n[func:AttackAnim,1][color:ff0000]crossword[color:000000][w:10][func:SetSansHead,Normal], right kiddo?", "leftwide", 310.5, 335, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Fight Sans" then
			if Encounter["FUN"][1] == "Rare" and Encounter["FUN"][2] == 2 then
				Encounter.Call("SetSansHead","Surprised")
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:papyrus][voice:papyrus]NO SANS ES TODO!", "leftwide", 156.5, 395, 10, 90, 1)
				else
					Bubble("[noskip][font:papyrus][voice:papyrus]NO SANS I'M DONE!", "leftwide", 156.5, 395, 10, 90, 1)
				end
			else
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:papyrus][voice:papyrus]Me sorprende que\nsepas cómo\npelear.", "leftwide", 156.5, 395, 10, 90, 1)
				else
					Bubble("[noskip][font:papyrus][voice:papyrus]I'm a bit surprised\nthat you know\nhow to put a\nfight.", "leftwide", 156.5, 395, 10, 90, 1)
				end
			end
		elseif Encounter["StatusPhase3"][2] == "Miss Papyrus" then
			Encounter.Call("SetSansHead","Worried")
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:sans][voice:sans]vamos hermano[w:10], dales un\ndescanso[w:10], eres demasiado\npara ellos.", "leftwide", 310.5, 335, 10, 90, 1)
			else
				Bubble("[noskip][font:sans][voice:sans]come on bro[w:10], give them\na break[w:10], you are just\ntoo much for them.", "leftwide", 310.5, 335, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Miss Sans" then
			Encounter.Call("SetHead","Disgust")
			Bubble("[noskip][font:papyrus][voice:papyrus]Sans...", "leftwide", 156.5, 395, 10, 90, 1)
		elseif Encounter["StatusPhase3"][2] == "Item" then
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:sans][voice:sans]hey papyrus[w:10], dónde\ndejaste los [color:ff0000]otros\nobjetos[color:000000][func:AttackAnim,1]?", "leftwide", 310.5, 335, 10, 90, 1)
			else
				Bubble("[noskip][font:sans][voice:sans]hey papyrus[w:10], were did\nyou leave the [color:ff0000]other\nitems[color:000000][func:AttackAnim,1]?", "leftwide", 310.5, 335, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Spare" then
			Encounter.Call("SetHead","Happy")
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]WOWIE![w:10][func:SetHead,Normal 1] SABÍA QUE\nPODÍAS HACERLO!", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]WOWIE![w:10][func:SetHead,Normal 1] I KNEW YOU\nCOULD DO IT!", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Flee" then
			Encounter.Call("SetHead","Angry")
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus][waittall:0.5]Y TÚ SOLO TE VAS\nSIN DECIR NI UNA\nSOLA PALABRA!", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus][waittall:0.5]AND YOU JUST\nLEAVE WITHOUT\nSAYING A WORD!", "leftwide", 156.5, 395, 10, 90, 1)
			end
		end
		pudinTimer = 33
	elseif pudinTimer == 33 and Bubbles[1] and not Bubbles[1].Activo then
		if Encounter["StatusPhase3"][2] == "Check Papyrus" then
			Encounter.Call("SetHead","Disgust")
			Encounter.Call("AttackAnim", 1)
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]Pero no quiero\nla atención solo\npara mí.", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]But I don't want\nall the attention\njust for me.", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Check Sans" then
			Encounter.Call("SetSansHead","Wink")
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:sans][voice:sans]bueno[w:10], solo[next] quería agregar algo de diversión a la batalla.", "leftwide", 310.5, 335, 10, 90, 1)
			else
				Bubble("[noskip][font:sans][voice:sans]well[w:10], i[next] just wanted to add some fun to the battle.", "leftwide", 310.5, 335, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Flirt" then
			Encounter.Call("SetHead","Angry")
			Encounter.Call("SetSansHead","Wink")
			Encounter["Sans"]["Body"].Set("Sans/Body/Joking")
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]SANS!!![w:10] Por qué\nno puedes tomar\nesta pelea en\nserio?", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]SANS!!![w:10] Why can't\nyou take this\nfight serious?", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Cry" then
			if Encounter["StatusPhase3"][1] == "Fight Papyrus" or Encounter["StatusPhase3"][1] == "Cry" then
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:papyrus][voice:papyrus]Sans cuida al\nhumano mientras\nno estoy.", "leftwide", 156.5, 395, 10, 90, 1)
				else
					Bubble("[noskip][font:papyrus][voice:papyrus]Sans take care\nof the human\nwhile I'm gone.", "leftwide", 156.5, 395, 10, 90, 1)
				end
			else
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:papyrus][voice:papyrus]QUÉ?![w:10][func:SetHead,Angry] CÓMO\nPUDISTE HUMANO!", "leftwide", 156.5, 395, 10, 90, 1)
				else
					Bubble("[noskip][font:papyrus][voice:papyrus]WHAT?![w:10][func:SetHead,Angry] HOW COULD\nYOU HUMAN!", "leftwide", 156.5, 395, 10, 90, 1)
				end
			end
		elseif Encounter["StatusPhase3"][2] == "Pun" then
			Encounter.Call("SetHead","Disgust")
			Encounter.Call("AttackAnim", 1)
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]Preferiría\nevitar todo en\nese tema.", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]I would prefer\nto avoid all in\nthat subject.", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Kick" then
			Encounter.Call("SetHead","Normal 1")
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]Entonces[w:10], qué\ntal si le enseñas\nla lección al\nhumano sans?", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]Then[w:10], how about\nyou teach some\nof the lesson to\nthe human sans?", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Fight Papyrus" then
			Encounter.Call("SetHead", "Disgust")
			Encounter.Call("SetSansHead","Wink")
			Encounter["Sans"]["Body"].Set("Sans/Body/Joking")
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]PFF[w:10], VAMOS AHORA![w:10][func:SetHead,Normal 1]\nSi así es como\nes la cosa.", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]PFF[w:10], COME ON NOW![w:10][func:SetHead,Normal 1]\nIf that's how the\nthing is.", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Fight Sans" then
			if Encounter["FUN"][1] == "Rare" and Encounter["FUN"][2] == 2 then
				Encounter.Call("SetSansHead","Worried")
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:papyrus][voice:papyrus]NO VOY A LIDIAR\nCON ESTO MÁS!", "leftwide", 156.5, 395, 10, 90, 1)
				else
					Bubble("[noskip][font:papyrus][voice:papyrus]I WON'T DEAL WITH\nTHIS ANYMORE!", "leftwide", 156.5, 395, 10, 90, 1)
				end
			else
				Encounter.Call("SetHead","Normal 1")
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:papyrus][voice:papyrus]Crees que puedas\nmanejar al\nhumano por un\nmomento sans?", "leftwide", 156.5, 395, 10, 90, 1)
				else
					Bubble("[noskip][font:papyrus][voice:papyrus]Think you can\nhandle the human\nfor a moment\nsans?", "leftwide", 156.5, 395, 10, 90, 1)
				end
			end
		elseif Encounter["StatusPhase3"][2] == "Miss Papyrus" then
			Encounter.Call("SetSansHead","Wink")
			Encounter["Sans"]["Body"].Set("Sans/Body/Joking")
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:sans][voice:sans]dejalos con el tío sans\npor un momento.", "leftwide", 310.5, 335, 10, 90, 1)
			else
				Bubble("[noskip][font:sans][voice:sans]leave them to the uncle\nsans for a moment.", "leftwide", 310.5, 335, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Miss Sans" then
			Encounter.Call("SetSansHead","Worried")
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:sans][voice:sans]oh vamos papyrus[w:10],\na veces necesitas dejar\nde ser una [func:SetSansHead,Joking][color:ff0000]papaya[color:000000].", "leftwide", 310.5, 335, 10, 90, 1)
			else
				Bubble("[noskip][font:sans][voice:sans]oh come on papyrus[w:10],\nsometimes you need to\nstop being a [func:SetSansHead,Joking][color:ff0000]papaya[color:000000].", "leftwide", 310.5, 335, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Item" then
			Encounter.Call("SetSansHead","Worried")
			Encounter.Call("SetHead","Thinking")
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:sans][voice:sans]por cierto[w:10], cómo\ncambiaste los objetos\ndel humano con tu [color:ff0000]espagu[next]eti.", "leftwide", 310.5, 335, 10, 90, 1)
			else
				Bubble("[noskip][font:sans][voice:sans]also[w:10], how did you change\nthe items of the human\nwith your [color:ff0000]spagh[next]etti.", "leftwide", 310.5, 335, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Spare" then
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]Pero aún así\nnecesitas saber\nlas consecuencias\nde tus acciones.", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]But you still\nneed to know the\nconsequences of\nyour actions.", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Flee" then
			Encounter.Call("SetSansHead", "Worried")
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:sans][voice:sans]cálmate papyrus[w:10],\ntalvez los estás\npresionando demasiado.", "leftwide", 310.5, 335, 10, 90, 1)
			else
				Bubble("[noskip][font:sans][voice:sans]calm down papyrus[w:10],\nmaybe you're putting\nthem into a lot of\npressure.", "leftwide", 310.5, 335, 10, 90, 1)
			end
		end
		pudinTimer = 34
	elseif pudinTimer == 34 and Bubbles[1] and not Bubbles[1].Activo then
		if Encounter["StatusPhase3"][2] == "Check Papyrus" then
			Encounter.Call("SetHead","Happy")
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]En lugar de eso\nte dejaré con\nmi hermano.", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]Instead of that\nI'll leave you\nwith my brother.", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Check Sans" then
			Encounter.Call("SetSansHead","Joking")
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]Si no vas a\ntomarte esto en\nserio[w:10], entonces\nme voy de aquí.", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]if you won't take\nthis serious[w:10], then\nI'm getting out of\nthis.", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Flirt" then
			Encounter.Call("SetHead","Disgust")
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]Ya que te gusta\nhacer bromas[w:10],\ncuentalé unas\nal humano.", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]Since you like to\nmake jokes[w:10], then\ntell some jokes\nto the human.", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Cry" then
			if Encounter["StatusPhase3"][1] == "Fight Papyrus" or Encounter["StatusPhase3"][1] == "Cry" then
				Encounter.Call("SetSansHead","Wink")
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:sans][voice:sans]okay hermano.", "leftwide", 310.5, 335, 10, 90, 1)
				else
					Bubble("[noskip][font:sans][voice:sans]alright bro.", "leftwide", 310.5, 335, 10, 90, 1)
				end
			else
				Encounter.Call("SetHead","Disgust")
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:sans][voice:sans]dame un momento con\nel humano papyrus[w:10],\npor favor.", "leftwide", 310.5, 335, 10, 90, 1)
				else
					Bubble("[noskip][font:sans][voice:sans]gimme a moment with\nthe human papyrus[w:10],\nplease.", "leftwide", 310.5, 335, 10, 90, 1)
				end
			end
		elseif Encounter["StatusPhase3"][2] == "Pun" then
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]Preguntale a\nsans[w:10], tiene muchos\nconsejos para\nbromas.", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]Try asking sans[w:10],\nhe's got plenty\nof pun advice.", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Kick" then
			Encounter.Call("SetSansHead","Wink")
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:sans][voice:sans]suena bien para mí.", "leftwide", 310.5, 335, 10, 90, 1)
			else
				Bubble("[noskip][font:sans][voice:sans]sounds good to me.", "leftwide", 310.5, 335, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Fight Papyrus" then
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]Por qué ustedes\ndos no comparten\npensamientos\nsobre eso?", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]Why don't you two\nshare thoughts\nabout that?", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Fight Sans" then
			if Encounter["FUN"][1] == "Rare" and Encounter["FUN"][2] == 2 then
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:papyrus][voice:papyrus]LIDIA CON EL\nHUMANO TÚ MISMO![w:10]\nYO ME LARGO!", "leftwide", 156.5, 395, 10, 90, 1)
				else
					Bubble("[noskip][font:papyrus][voice:papyrus]DEAL WITH THE\nHUMAN YOURSELF![w:10]\nI'M DONE!", "leftwide", 156.5, 395, 10, 90, 1)
				end
			else
				Encounter.Call("SetSansHead","Wink")
				if GetAlMightyGlobal("Idioma") == "Spanish" then
					Bubble("[noskip][font:sans][voice:sans]seguro que puedo\npapyrus.", "leftwide", 310.5, 335, 10, 90, 1)
				else
					Bubble("[noskip][font:sans][voice:sans]sure i can papyrus.", "leftwide", 310.5, 335, 10, 90, 1)
				end
			end
		elseif Encounter["StatusPhase3"][2] == "Miss Papyrus" then
			Encounter["Sans"]["Body"].Set("Sans/Body/Left")
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]...[w:10]talvez tienes\nrazón sans.[w:10]\nDe acuerdo[w:10], tú\nestás a cargo.", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]...[w:10]maybe you are\nright sans.[w:10]\nAlright[w:10], you're in\ncharge.", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Miss Sans" then
			Encounter.Call("SetSansHead","Wink")
			Encounter["Sans"]["Body"].Set("Sans/Body/Joking")
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]Sabes que[w:10], me\ncansé[w:10], rompiste\nmi paciencia.", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]You know what[w:10],\nI'm done[w:10], you\nbroke my patience.", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Item" then
			Encounter.Call("SetSansHead","Surprised")
			Encounter.Call("SetHead","Happy")
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus][waittall:0.5]OH! ACABO DE\nRECORDAR QUE\nDEJÉ ESPAGUETI\nEN EL HORNO!![w:10][next] ", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus][waittall:0.5]OH! I JUST\nREMEMBERED I\nLEFT SPAGHETTI\nIN THE OVEN!![w:10][next] ", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Spare" then
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]Sans cuida al\nhumano por un\nmomento.", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]Sans take care\nof the human for\na moment.", "leftwide", 156.5, 395, 10, 90, 1)
			end
		elseif Encounter["StatusPhase3"][2] == "Flee" then
			Encounter.Call("SetHead","Disgust")
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus][waittall:10]...[w:20][waittall:1]ok[w:10], cuida al\nhumano mientras\nme calmo.", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus][waittall:10]...[w:20][waittall:1]ok[w:10], take care of\nthe human while\nI calm down.", "leftwide", 156.5, 395, 10, 90, 1)
			end
		end
		pudinTimer = 35
	elseif pudinTimer == 35 and Bubbles[1] and not Bubbles[1].Activo then
		if Encounter["StatusPhase3"][2] == "Check Papyrus" then
			Encounter.Call("SetHead","Normal 1")
		elseif Encounter["StatusPhase3"][2] == "Fight Papyrus" then
			Encounter.Call("SetHead","Disgust")
		end
		if Encounter["StatusPhase3"][2] == "Cry" and Encounter["StatusPhase3"][1] ~= "Fight Papyrus" and Encounter["StatusPhase3"][1] ~= "Cry" then
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]Muy bien hermano[w:10],\ndiscutiremos el\nresto más tarde.", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]Alright bro[w:10], we'll\ndiscuss the rest\nlater.", "leftwide", 156.5, 395, 10, 90, 1)
			end
		else
			Encounter.Call("SetSansHead","Normal")
			Encounter["Sans"]["Body"].Set("Sans/Body/Left")
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:papyrus][voice:papyrus]Discutiremos el\nresto más tarde.", "leftwide", 156.5, 395, 10, 90, 1)
			else
				Bubble("[noskip][font:papyrus][voice:papyrus]We'll discuss the\nrest later.", "leftwide", 156.5, 395, 10, 90, 1)
			end
		end
		pudinTimer = 36
	elseif pudinTimer >= 36 and pudinTimer < 96 and Bubbles[1] and not Bubbles[1].Activo then
		pudinTimer = pudinTimer + 1
		Paps.X = 20 + 310*math.cos(math.rad(90/60*(pudinTimer - 36)))
		Encounter.Call("PapyrusAlpha", math.cos(math.rad(90/60*(pudinTimer - 36))))
	elseif pudinTimer >= 96 and pudinTimer < 126 then
		pudinTimer = pudinTimer + 1
		Sans.X = 405 + 85*math.cos(math.rad(180/30*(pudinTimer - 96)))
		Encounter.Call("SansAlpha", 0.75 - 0.25*math.cos(math.rad(180/30*(pudinTimer - 96))))
	elseif pudinTimer == 126 then
		Encounter["BackgroundAnimation"] = "Fade"
		if Encounter["StatusPhase3"][2] == "Cry" and Encounter["StatusPhase3"][1] ~= "Fight Papyrus" and Encounter["StatusPhase3"][1] ~= "Cry" then
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:sans][voice:sans]si crees que peudes\nengañar a mi hermano\ncon tus [color:ff0000]lágrimas falsas[color:000000].", "rightwide", 499.5, 335, 40, 90, 1)
			else
				Bubble("[noskip][font:sans][voice:sans]if you think that you\ncan fool my brother\nwith your [color:ff0000]fake tears[color:000000].", "rightwide", 499.5, 335, 40, 90, 1)
			end
		else
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:sans][voice:sans]mira[w:10], si esperas\npelear conmigo...", "rightwide", 499.5, 335, 40, 90, 1)
			else
				Bubble("[noskip][font:sans][voice:sans]look[w:10], if you're hoping\nfor a fight with me...", "rightwide", 499.5, 335, 40, 90, 1)
			end
		end
		pudinTimer = 127
	elseif pudinTimer == 127 and Bubbles[1] and not Bubbles[1].Activo then
		if Encounter["StatusPhase3"][2] == "Cry" and Encounter["StatusPhase3"][1] ~= "Fight Papyrus" and Encounter["StatusPhase3"][1] ~= "Cry" then
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:sans][voice:sans]déjame decirte que no\nfuncionará mientras\nyo esté aquí.", "rightwide", 499.5, 335, 40, 90, 1)
			else
				Bubble("[noskip][font:sans][voice:sans]let me tell you that it\nwon't work while i still\nhere.", "rightwide", 499.5, 335, 40, 90, 1)
			end
		else
			Encounter.Call("SetSansHead","Funny")
			if GetAlMightyGlobal("Idioma") == "Spanish" then
				Bubble("[noskip][font:sans][voice:sans]eheheheheh...[w:10]\nentonces es tu día\nde suerte.", "rightwide", 499.5, 335, 40, 90, 1)
			else
				Bubble("[noskip][font:sans][voice:sans]eheheheheh...[w:10]\nthen it's your lucky\nday.", "rightwide", 499.5, 335, 40, 90, 1)
			end
		end
		pudinTimer = 128
	elseif pudinTimer == 128 and Bubbles[1] and not Bubbles[1].Activo then
		if Encounter["StatusPhase3"][2] == "Cry" and Encounter["StatusPhase3"][1] ~= "Fight Papyrus" and Encounter["StatusPhase3"][1] ~= "Cry" then
			Encounter.Call("SetSansHead","zzz")
		else
			Encounter.Call("SetSansHead","Normal")
		end
		Encounter["Sans"]["Body"].Set("Sans/Body/Joking")
		if GetAlMightyGlobal("Idioma") == "Spanish" then
			Bubble("[noskip][font:sans][voice:sans]honestamente solo\nespero que te des\ncuenta que mereces\ntodo esto.", "rightwide", 499.5, 335, 40, 90, 1)
		else
			Bubble("[noskip][font:sans][voice:sans]i honestly just hope\nyou realise that you\ndeserve all of this.", "rightwide", 499.5, 335, 40, 90, 1)
		end
		pudinTimer = 129
	elseif pudinTimer == 129 and Bubbles[1] and not Bubbles[1].Activo then
		Encounter.Call("SetSansHead","Normal")
		Encounter["Sans"]["Body"].Set("Sans/Body/Left")
		Arena.Resize(360, 130)
		state = 2
		pudinTimer = 130
	elseif pudinTimer >= 130 then
		if Encounter["GameMusic"] == "Wait 3" then
			Encounter.Call("ContinueMusic")
		end
		pudinTimer = pudinTimer + 1
		if pudinTimer == 140 then
			table.insert(Bones, {Body = CreateProjectileAbs("Bullets/Bones/BodyS", 500, 123), Head = CreateProjectileAbs("Bullets/Bones/HeadS", 0, 0), Legs = CreateProjectileAbs("Bullets/Bones/HeadS", 0, 0), Scale = 44, Vel = -3})
			table.insert(Bones, {Body = CreateProjectileAbs("Bullets/Bones/BodyS", 500, 199), Head = CreateProjectileAbs("Bullets/Bones/HeadS", 0, 0), Legs = CreateProjectileAbs("Bullets/Bones/HeadS", 0, 0), Scale = 40, Vel = -3})
			table.insert(Bones, {Body = CreateProjectileAbs("Bullets/Bones/BodyS", 140, 123), Head = CreateProjectileAbs("Bullets/Bones/HeadS", 0, 0), Legs = CreateProjectileAbs("Bullets/Bones/HeadS", 0, 0), Scale = 44, Vel = 3})
			table.insert(Bones, {Body = CreateProjectileAbs("Bullets/Bones/BodyS", 140, 199), Head = CreateProjectileAbs("Bullets/Bones/HeadS", 0, 0), Legs = CreateProjectileAbs("Bullets/Bones/HeadS", 0, 0), Scale = 40, Vel = 3})
		end
		if Encounter["GameMusic"] == "Loop 3" then
			if SongTime <= 24.02 and pudinTimer%90 == 0 then
				for i=0,1 do
					Plataforma = CreateProjectileAbs("Bullets/Platforms/70", 680 - 720*i, 137 + 48*i)
					Plataforma.SetVar("VelX", -2 + 4*i)
					Plataforma.SetVar("Plataforma", true)
					Plataforma.ppcollision = false
					table.insert(Platforms, Plataforma)
				end
			end
			if SongTime <= 11.2 then
				if pudinTimer > 260 and pudinTimer%45 == 0 then
					if pudinTimer%90 == 0 then
						table.insert(GB, {Sprite = CreateSprite("Bullets/GB Sans/0","BelowBullet"), Scale = 0.5, Type = "Sans", Animacion = {DatosIniciales = {X = -50, Y = 530, rotation = 0}, DatosFinales = {X = 70, Y = 60 + 48*math.random(3), rotation = 90}}, Delay = 30, Duration = 24, NoShake = true})
					else
						table.insert(GB, {Sprite = CreateSprite("Bullets/GB Sans/0","BelowBullet"), Scale = 0.5, Type = "Sans", Animacion = {DatosIniciales = {X = 690, Y = 530, rotation = 0}, DatosFinales = {X = 570, Y = 60 + 48*math.random(3), rotation = -90}}, Delay = 30, Duration = 24, NoShake = true})
					end
					Audio.PlaySound("gasterintro")
				end
			else
				if phases[1] == 0 then
					if SongTime > 14.2 then
						if Encounter["Animation"] == "Calmado" or Encounter["Animation"] == "None Phase 3" then
							Encounter["Animation"] = "Alocado"
							Encounter["velanim"] = 1.2
							Encounter["vel"] = 0
						end
						Encounter["BackgroundAnimation"] = "Normal"
						if SongTime <= 14.4 then
							Paps.X = 80 + 250*math.sin(math.rad(90/0.3*(SongTime - 14.1)))
							Sans.X = 405 - 85*math.cos(math.rad(180/0.3*(SongTime - 14.1)))
							Encounter.Call("PapyrusAlpha", math.sin(math.rad(90/0.3*(SongTime - 14.1))))
							Encounter.Call("SansAlpha", 0.75 + 0.25*math.cos(math.rad(180/0.3*(SongTime - 14.1))))
						else
							Paps.X = 330
							Sans.X = 490
							Encounter.Call("PapyrusAlpha", 1)
							Encounter.Call("SansAlpha", 0.5)
							table.insert(GB, {Sprite = CreateSprite("Bullets/GB Papyrus/0","BelowBullet"), Scale = 0.5, Type = "Papyrus", Animacion = {DatosIniciales = {X = 690, Y = 530, rotation = 0}, DatosFinales = {X = newpX, Y = 300, rotation = 0}, VelAppearing = 20}, Delay = 0, Duration = 30, NoShake = true})
							table.insert(GB, {Sprite = CreateSprite("Bullets/GB Papyrus/0","BelowBullet"), Scale = 0.5, Type = "Papyrus", Animacion = {DatosIniciales = {X = -50, Y = 530, rotation = 0}, DatosFinales = {X = 70, Y = 135, rotation = 90}, VelAppearing = 15}, Delay = 35, Duration = 30, NoShake = true})
							Audio.PlaySound("gasterintro2")
							maniac = true
							phases[1] = 1
						end
					end
				elseif phases[1] >= 1 and phases[1] <= 13 then
					if SongTime > 15.85 + 0.2*(phases[1] - 1) then
						if phases[1] >= 5 then
							table.insert(GB, {Sprite = CreateSprite("Bullets/GB Papyrus/0","BelowBullet"), Scale = 0.5, Type = "Papyrus", Animacion = {DatosIniciales = {X = -50, Y = 530, rotation = 0}, DatosFinales = {X = 160 + 33*(phases[1] - 5), Y = 300, rotation = 0}, VelAppearing = 10}, Delay = 0, Duration = 30, NoShake = true})
							Audio.PlaySound("gasterintro2")
						end
						phases[1] = phases[1] + 1
					end
				elseif phases[1] == 14 then
					if SongTime > 19.2 then
						if maniac then
							maniac = nil
							Bubble("", "", 0, 0, 0, 0, 1)
						end
						if SongTime <= 19.4 then
							Paps.X = 285 + 45*math.cos(math.rad(180/0.2*(SongTime - 19.2)))
							Sans.X = 450 + 40*math.cos(math.rad(180/0.2*(SongTime - 19.2)))
							Encounter.Call("SansAlpha", 0.75 - math.cos(math.rad(180/0.2*(SongTime - 19.2)))/4)
						else
							Paps.X = 240
							Sans.X = 410
							Encounter.Call("SansAlpha", 1)
							phases[1] = 15
						end
					end
				elseif phases[1] == 15 then
					if SongTime > 20.45 then
						if not BunchPaps then
							BunchPaps = CreateProjectileAbs("Bullets/Bones/BunchBonesPaps", 70, 390)
						end
						if not BunchSans then
							BunchSans = CreateProjectileAbs("Bullets/Bones/BunchBonesSans", 570, 390)
						end
						if SongTime <= 22.9 then
							BunchPaps.sprite.rotation = 45 - 360*5/2.45*(SongTime - 20.45)
							BunchSans.sprite.rotation = -45 + 360*5/2.45*(SongTime - 20.45)
							BunchPaps.sprite.alpha = math.sin(math.rad(90/0.15*math.min(SongTime - 20.45, 0.15)))
							BunchSans.sprite.alpha = math.sin(math.rad(90/0.15*math.min(SongTime - 20.45, 0.15)))
						else
							BunchPaps.sprite.rotation = 45
							BunchSans.sprite.rotation = -45
							BunchPaps.sprite.alpha = 1
							BunchSans.sprite.alpha = 1
							Bubble("[noskip][font:sans][voice:sans]uh[w:4], nyeh.[w:100000000] ", "leftwide", 230.5, 335, 10, 90, 1)
							phases[1] = 16
						end
						BunchPaps.MoveToAbs(70, 390)
						BunchSans.MoveToAbs(570, 390)
					end
				elseif phases[1] == 16 then
					if SongTime > 22.9 then
						if SongTime <= 23.4 then
							BunchPaps.MoveToAbs(550 - 480*math.cos(math.rad(90/0.5*(SongTime - 22.9))), -90 + 480*math.cos(math.rad(90/0.5*(SongTime - 22.9))))
							BunchSans.MoveToAbs(90 + 480*math.cos(math.rad(90/0.5*(SongTime - 22.9))), -90 + 480*math.cos(math.rad(90/0.5*(SongTime - 22.9))))
						else
							BunchPaps.Remove()
							BunchSans.Remove()
							BunchPaps = nil
							BunchSans = nil
							phases[1] = 17
						end
					end
				elseif phases[1] == 17 then
					if SongTime > 24.03 then
						Black = CreateSprite("Pixel","Top")
						Black.color = {0,0,0}
						Black.Scale(640, 480)
						Black.MoveTo(320, 240)
						Bubble("", "", 0, 0, 0, 0, 1)
						Encounter.Call("AttackAnim", 2)
						Encounter.Call("SetHead", "Normal 1")
						Encounter["velanim"] = 1
						Paps.X = -100
						Sans.X = 740
						state = 0
						newpX = 320
						newpY = 160
						Encounter["BackgroundAnimation"] = "Fade"
						Encounter["BGY"] = -300
						Papyrus = CreateSprite("Papyrus/Dance 2")
						Papyrus.SetPivot(0.5, 0)
						Papyrus.MoveTo(160, 240)
						PapsSprite = "Dance"
						Sans2 = CreateSprite("Sans/Dance 1")
						Sans2.SetPivot(0.5, 0)
						Sans2.MoveTo(490, 238)
						Line = CreateSprite("Specials/Line","BelowPlayer")
						Line.MoveTo(320, 160)
						PointsPaps = CreateSprite("Numbers/0","BelowPlayer")
						PointsPaps.MoveTo(270, 200)
						PointsSans = CreateSprite("Numbers/0","BelowPlayer")
						PointsSans.MoveTo(370, 200)
						PlatL = CreateSprite("Bullets/Platforms/70","BelowPlayer")
						PlatL.rotation = -90
						PlatL.MoveTo(60, 160)
						PlatL.SetVar("AimY", 160)
						PlatR = CreateSprite("Bullets/Platforms/70","BelowPlayer")
						PlatR.rotation = 90
						PlatR.MoveTo(580, 160)
						PlatR.SetVar("AimY", 160)
						Puntos = {Papyrus = 0, Sans = 0}
						RecolorSoul()
						Arena.Resize(660, 130)
						for i=1,#Platforms do
							local bullet = Platforms[i - tableaux]
							bullet.Remove()
							table.remove(Platforms, i - tableaux)
							tableaux = tableaux + 1
						end
						tableaux = 0
						phases[1] = 18
					end
				elseif phases[1] == 18 and SongTime > 26.4 then
					Black.Remove()
					Black = nil
					if GetAlMightyGlobal("Idioma") == "Spanish" then
						Bubble("[noskip][font:papyrus][voice:papyrus]ADMIRA!!![w:5]\nMI ATAQUE\nESPECIAL![w:1000000000] ", "rightwide", 320.5, 395, 40, 90, 1)
					else
						Bubble("[noskip][font:papyrus][voice:papyrus]BEHOLD!!![w:5]\nMY SPECIAL\nATTACK![w:1000000000] ", "rightwide", 320.5, 395, 40, 90, 1)
					end
					phases[1] = 19
				elseif phases[1] == 19 and SongTime > 28.5 then
					if GetAlMightyGlobal("Idioma") == "Spanish" then
						Bubble("[noskip][font:sans][voice:sans]bueno[w:5], fue idea mia...[w:100000000] ", "leftwide", 310.5, 335, 10, 90, 1)
					else
						Bubble("[noskip][font:sans][voice:sans]well[w:5], it was my idea...[w:100000000] ", "leftwide", 310.5, 335, 10, 90, 1)
					end
					phases[1] = 20
				elseif phases[1] == 20 and SongTime > 30 then
					if GetAlMightyGlobal("Idioma") == "Spanish" then
						Bubble("[noskip][font:papyrus][voice:papyrus][waittall:0.5]Los detalles\nson aburridos.[w:1000000000] ", "rightwide", 320.5, 395, 40, 90, 1)
					else
						Bubble("[noskip][font:papyrus][voice:papyrus][waittall:0.5]Details are\nboring.[w:1000000000] ", "rightwide", 320.5, 395, 40, 90, 1)
					end
					phases[1] = 21
				elseif phases[1] == 21 and SongTime > 31.2 then
					Bubble("", "", 0, 0, 0, 0, 1)
					Audio.PlaySound("ding")
					state = 3
					RecolorSoul()
					Heart = CreateSprite("Undertale/Game Over/Soul","Top")
					Heart.MoveTo(Player.absx, Player.absy)
					Heart.color = Player.sprite.color
					Heart.rotation = Player.sprite.rotation
					phases[1] = 22
				elseif phases[1] == 22 then
					if SongTime > 31.2 then
						if SongTime <= 32.7 then
							newpX = 320 - 248/1.5*(SongTime - 31.2)
						else
							newpX = 68
							Player.SetControlOverride(false)
							if newpY > PlatL.y + 36 or newpY < PlatL.y - 36 then
								out = true
							else
								if math.random(2) == 1 then
									PlatL.SetVar("AimY", 190)
									bounce = "Up"
								else
									PlatL.SetVar("AimY", 130)
									bounce = "Down"
								end
								Audio.PlaySound("bouncePlat")
								state = 4
								RecolorSoul()
							end
							phases[1] = 23
						end
					end
				elseif phases[1] == 23 then
					if SongTime > 32.7 then
						if SongTime <= 36.3 then
							if out then
								newpX = 320 - 248/1.5*(SongTime - 31.2)
								if newpX <= -10 then
									out = nil
									Audio.PlaySound("Congratulations")
									if not safe then
										for i=0,10 do
											local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
											table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
											table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
										end
									else
										for i=0,5 do
											local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
											table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
											table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
										end
									end
									Puntos.Sans = Puntos.Sans + 1
									if math.random(2) == 1 then
										if not repositionated1 then
											PlatL.SetVar("AimY", 190)
										end
										bounce = "Up"
									else
										if not repositionated1 then
											PlatL.SetVar("AimY", 130)
										end
										bounce = "Down"
									end
									state = 4
									RecolorSoul()
									if Player.hp > 20 then
										Player.Hurt(20)
									else
										finish = true
									end
								end
							else
								newpX = 68 + 504/3.6*(SongTime - 32.7)
							end
						else
							if out then
								Audio.PlaySound("Congratulations")
								if not safe then
									for i=0,10 do
										local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
									end
								else
									for i=0,5 do
										local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
									end
								end
								Puntos.Sans = Puntos.Sans + 1
								out = nil
								if Player.hp > 20 then
									Player.Hurt(20)
								else
									finish = true
								end
							end
							newpX = 572
							state = 5
							RecolorSoul()
							Audio.PlaySound("bouncePlat")
							phases[1] = 24
						end
						if SongTime > 34.1 and not repositionated1 then
							PlatL.SetVar("AimY", math.random(130, 190))
							repositionated1 = true
						end
						if SongTime > 35.3 and not repositionated2 then
							if math.random(2) == 1 then
								PlatR.SetVar("AimY", 150)
							else
								PlatR.SetVar("AimY", 170)
							end
							repositionated2 = true
						end
						if SongTime > 35.5 and not repositionated3 then
							PlatR.SetVar("AimY", 160)
							repositionated3 = true
						end
						if SongTime > 35.9 and not repositionated4 then
							PlatR.SetVar("AimY", -1)
							repositionated4 = true
						end
						if SongTime > 36.3 and not repositionated6 then
							PlatR.SetVar("AimY", PlatR.y)
							repositionated6 = true
						end
					end
				elseif phases[1] == 24 then
					if SongTime > 36.3 then
						if SongTime <= 38.1 then
							newpX = 572 - 504/1.8*(SongTime - 36.3)
						else
							newpX = 68
							if newpY > PlatL.y + 36 or newpY < PlatL.y - 36 then
								out = true
							else
								state = 6
								RecolorSoul()
								Audio.PlaySound("bouncePlat")
							end
							PlatL.SetVar("AimY", PlatL.y)
							phases[1] = 25
						end
						if SongTime > 37.1 and not repositionated5 then
							PlatL.SetVar("AimY", -1)
							repositionated5 = true
						end
					end
				elseif phases[1] == 25 then
					if SongTime > 38.1 then
						if SongTime <= 39.3 then
							if out then
								newpX = 572 - 504/1.8*(SongTime - 36.3)
								if newpX <= -10 then
									out = nil
									Audio.PlaySound("Congratulations")
									if not safe then
										for i=0,10 do
											local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
											table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
											table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
										end
									else
										for i=0,5 do
											local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
											table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
											table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
										end
									end
									Puntos.Sans = Puntos.Sans + 1
									state = 6
									RecolorSoul()
									if Player.hp > 20 then
										Player.Hurt(20)
									else
										finish = true
									end
								end
							else
								newpX = 68 + 504/1.2*(SongTime - 38.1)
							end
						else
							newpX = 572
							if out then
								out = nil
								Audio.PlaySound("Congratulations")
								if not safe then
									for i=0,10 do
										local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
									end
								else
									for i=0,5 do
										local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
									end
								end
								Puntos.Sans = Puntos.Sans + 1
								if Player.hp > 20 then
									Player.Hurt(20)
								else
									finish = true
								end
							end
							state = 7
							RecolorSoul()
							Audio.PlaySound("bouncePlat")
							phases[1] = 26
						end
						if SongTime > 38.5 and not repositionated7 then
							if math.random(2) == 1 then
								PlatR.SetVar("AimY", 130)
								PlatL.SetVar("AimY", 130)
							else
								PlatR.SetVar("AimY", 190)
								PlatL.SetVar("AimY", 190)
							end
							repositionated7 = true
						end
						if SongTime > 38.9 and not repositionated8 then
							PlatR.SetVar("AimY", -1)
							repositionated8 = true
						end
						if SongTime > 39.3 and not repositionated10 then
							PlatR.SetVar("AimY", 160)
							repositionated10 = true
						end
					end
				elseif phases[1] == 26 then
					if SongTime > 39.3 then
						if SongTime <= 40.7 then
							newpX = 572 - 590/1.4*(SongTime - 39.3)
						end
						if SongTime > 40.4 and not repositionated9 then
							if PlatL.y < 160 then
								PlatL.SetVar("AimY", 190)
							else
								PlatL.SetVar("AimY", 130)
							end
							repositionated9 = true
						end
						if newpX <= 68 and not damaged then
							if newpY > PlatL.y + 36 or newpY < PlatL.y - 36 then
								makedamage = true
							else
								table.insert(Shatter, {Sprite = CreateSprite("Pixel","BelowPlayer"), X = PlatL.x - 0.5, Y = PlatL.y, VelRot = math.random(-30, 30)/10, Vel = math.random(20,60)/10})
								table.insert(Shatter, {Sprite = CreateSprite("Pixel","BelowPlayer"), X = PlatL.x - 4, Y = PlatL.y + 34.5, VelRot = math.random(-30, 30)/10, Vel = math.random(20,60)/10})
								table.insert(Shatter, {Sprite = CreateSprite("Pixel","BelowPlayer"), X = PlatL.x - 7.5, Y = PlatL.y, VelRot = math.random(-30, 30)/10, Vel = math.random(20,60)/10})
								table.insert(Shatter, {Sprite = CreateSprite("Pixel","BelowPlayer"), X = PlatL.x - 4, Y = PlatL.y - 34.5, VelRot = math.random(-30, 30)/10, Vel = math.random(20,60)/10})
								table.insert(Shatter, {Sprite = CreateSprite("Pixel","BelowPlayer"), X = PlatL.x - 2.5, Y = PlatL.y, VelRot = math.random(-30, 30)/10, Vel = math.random(20,60)/10})
								table.insert(Shatter, {Sprite = CreateSprite("Pixel","BelowPlayer"), X = PlatL.x + 0.5, Y = PlatL.y + 34.5, VelRot = math.random(-30, 30)/10, Vel = math.random(20,60)/10})
								table.insert(Shatter, {Sprite = CreateSprite("Pixel","BelowPlayer"), X = PlatL.x + 3.5, Y = PlatL.y, VelRot = math.random(-30, 30)/10, Vel = math.random(20,60)/10})
								table.insert(Shatter, {Sprite = CreateSprite("Pixel","BelowPlayer"), X = PlatL.x + 0.5, Y = PlatL.y - 34.5, VelRot = math.random(-30, 30)/10, Vel = math.random(20,60)/10})
								for i=1,#Shatter do
									local Datos = Shatter[i]
									if i%2 == 0 then
										if i > 4 then
											Datos.Sprite.Scale(7, 1)
										else
											Datos.Sprite.Scale(8, 1)
										end
									else
										Datos.Sprite.Scale(1, 70)
									end
									if i > 4 then
										Datos.Sprite.color = {0,0.5,0}
									end
								end
								PlatL.alpha = 0
								PapsSprite = "Surprised"
								Audio.PlaySound("slam")
							end
							damaged = true
						end
						if SongTime > 40.7 then
							newpX = 320
							newpY = 160
							state = 0
							RecolorSoul()
							Audio.PlaySound("Congratulations")
							if not safe then
								for i=0,10 do
									local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
									table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
									table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
								end
							else
								for i=0,5 do
									local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
									table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
									table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
								end
							end
							Puntos.Sans = Puntos.Sans + 1
							Player.sprite.color = {0,60/255,1}
							PlatL.SetVar("AimY", 160)
							phases[1] = 27
						end
					end
				elseif phases[1] == 27 and SongTime > 41.87 then
					PapsSprite = "Disgust"
					if GetAlMightyGlobal("Idioma") == "Spanish" then
						Bubble("[noskip][font:papyrus][voice:papyrus][waittall:0.5]Espera...[w:5]\nEsto es apenas\nuna pelea.[w:1000000000] ", "rightwide", 320.5, 395, 40, 90, 1)
					else
						Bubble("[noskip][font:papyrus][voice:papyrus][waittall:0.5]Wait...[w:5]\nThis is barely\neven a fight.[w:1000000000] ", "rightwide", 320.5, 395, 40, 90, 1)
					end
					phases[1] = 28
				elseif phases[1] == 28 and SongTime > 43.74 then
					if GetAlMightyGlobal("Idioma") == "Spanish" then
						Bubble("[noskip][font:papyrus][voice:papyrus][waittall:0.5]Solo querías\njugar pong.[w:1000000000] ", "rightwide", 320.5, 395, 40, 90, 1)
					else
						Bubble("[noskip][font:papyrus][voice:papyrus][waittall:0.5]You just wanted\nto play pong.[w:1000000000] ", "rightwide", 320.5, 395, 40, 90, 1)
					end
					phases[1] = 29
				elseif phases[1] == 29 then
					if SongTime > 45.6 then
						if not Bone1 then
							PapsSprite = "Dance"
							Audio.PlaySound("ding")
							jump = 0
							state = 8
							RecolorSoul()
							Bubble("", "", 0, 0, 0, 0, 1)
							if PlatL.alpha <= 0 then
								PlatL.alpha = 1
								PlatE = CreateSprite("Bullets/Platforms/70","Top")
								PlatE.rotation = -90
								PlatE.MoveTo(60, 160)
							end
							Bone1 = CreateProjectileAbs("Bullets/Bones/BoneP", 66, 160)
							BoneE = CreateSprite("Bullets/Bones/BoneP","Top")
							BoneE.MoveTo(66, 160)
						end
						if SongTime <= 46.8 then
							Bone1.MoveToAbs(66 + 508/1.2*(SongTime - 45.6), 160)
						else
							if math.random(2) == 1 then
								Bone1.SetVar("Y", -math.random(3))
							else
								Bone1.SetVar("Y", math.random(3))
							end
							Bone1.MoveToAbs(574, 160)
							Audio.PlaySound("bouncePlat")
							phases[1] = 30
						end
						if Bone1.absx >= 500 then
							PlatR.SetVar("AimY", math.min(math.max(Bone1.absy, 130), 190))
						elseif Bone1.absx <= 140 then
							PlatL.SetVar("AimY", math.min(math.max(Bone1.absy, 130), 190))
						end
					end
				elseif phases[1] == 30 then
					if SongTime > 46.8 then
						if SongTime <= 48 then
							if Bone1.GetVar("Y") < 0 then
								Bone1.MoveToAbs(574 - 508/1.2*(SongTime - 46.8), math.max(Bone1.absy + Bone1.GetVar("Y"), 113))
								if Bone1.absy <= 113 then
									Bone1.SetVar("Y", -Bone1.GetVar("Y"))
									Audio.PlaySound("bounceWall")
								end
							else
								Bone1.MoveToAbs(574 - 508/1.2*(SongTime - 46.8), math.min(Bone1.absy + Bone1.GetVar("Y"), 207))
								if Bone1.absy >= 207 then
									Bone1.SetVar("Y", -Bone1.GetVar("Y"))
									Audio.PlaySound("bounceWall")
								end
							end
						else
							if Bone1.GetVar("Y") < 0 then
								Bone1.MoveToAbs(66, math.max(Bone1.absy + Bone1.GetVar("Y"), 113))
								Bone1.SetVar("Y", -math.random(3))
							else
								Bone1.MoveToAbs(66, math.min(Bone1.absy + Bone1.GetVar("Y"), 207))
								Bone1.SetVar("Y", math.random(3))
							end
							Audio.PlaySound("bouncePlat")
							phases[1] = 31
						end
						if Bone1.absx >= 500 then
							PlatR.SetVar("AimY", math.min(math.max(Bone1.absy, 130), 190))
						elseif Bone1.absx <= 140 then
							PlatL.SetVar("AimY", math.min(math.max(Bone1.absy, 130), 190))
						end
					end
				elseif phases[1] == 31 then
					if SongTime > 48 then
						if SongTime <= 49.2 then
							if Bone1.GetVar("Y") < 0 then
								Bone1.MoveToAbs(66 + 508/1.2*(SongTime - 48), math.max(Bone1.absy + Bone1.GetVar("Y"), 113))
								if Bone1.absy <= 113 then
									Bone1.SetVar("Y", -Bone1.GetVar("Y"))
									Audio.PlaySound("bounceWall")
								end
							else
								Bone1.MoveToAbs(66 + 508/1.2*(SongTime - 48), math.min(Bone1.absy + Bone1.GetVar("Y"), 207))
								if Bone1.absy >= 207 then
									Bone1.SetVar("Y", -Bone1.GetVar("Y"))
									Audio.PlaySound("bounceWall")
								end
							end
						else
							if Bone1.GetVar("Y") < 0 then
								Bone1.MoveToAbs(574, math.max(Bone1.absy + Bone1.GetVar("Y"), 113))
								Bone1.SetVar("Derivada", 1)
								Bone1.SetVar("PosY", Bone1.absy)
								Bone1.SetVar("DiffY", 113 - Bone1.absy)
							else
								Bone1.MoveToAbs(574, math.min(Bone1.absy + Bone1.GetVar("Y"), 207))
								Bone1.SetVar("Derivada", 2)
								Bone1.SetVar("PosY", Bone1.absy)
								Bone1.SetVar("DiffY", 185 - Bone1.absy)
							end
							Audio.PlaySound("bouncePlat")
							phases[1] = 32
						end
						if Bone1.absx >= 500 then
							PlatR.SetVar("AimY", math.min(math.max(Bone1.absy, 130), 190))
						elseif Bone1.absx <= 140 then
							PlatL.SetVar("AimY", math.min(math.max(Bone1.absy, 130), 190))
						end
					end
				elseif phases[1] == 32 then
					if SongTime > 49.2 then
						if SongTime <= 50.4 then
							if Bone1.GetVar("Derivada") == 1 then
								if SongTime <= 49.6 then
									Bone1.MoveToAbs(574 - 508/1.2*(SongTime - 49.2), Bone1.GetVar("PosY") + Bone1.GetVar("DiffY")/0.4*(SongTime - 49.2))
								else
									if not sonido then
										Audio.PlaySound("bounceWall")
										sonido = true
									end
									Bone1.MoveToAbs(574 - 508/1.2*(SongTime - 49.2), 113 + 72/0.8*(SongTime - 49.6))
								end
							else
								Bone1.MoveToAbs(574 - 508/1.2*(SongTime - 49.2), Bone1.GetVar("PosY") + Bone1.GetVar("DiffY")/1.2*(SongTime - 49.2))
							end
						else
							Bone1.MoveToAbs(66, 185)
							Bone2 = CreateProjectileAbs("Bullets/Bones/BoneP", 66, 185)
							Audio.PlaySound("bouncePlat")
							phases[1] = 33
						end
						if Bone1.absx >= 500 then
							PlatR.SetVar("AimY", math.min(math.max(Bone1.absy, 130), 190))
						elseif Bone1.absx <= 140 then
							PlatL.SetVar("AimY", math.min(math.max(Bone1.absy, 130), 190))
						end
					end
				elseif phases[1] == 33 then
					if SongTime > 50.4 then
						if SongTime <= 51.6 then
							if SongTime <= 50.5 then
								Bone1.MoveToAbs(66 + 508/1.2*(SongTime - 50.4), 185 + 22/0.1*(SongTime - 50.4))
								Bone2.MoveToAbs(66 + 508/1.2*(SongTime - 50.4), 185 + 22/0.1*(SongTime - 50.4))
							else
								if not sonido1 then
									Audio.PlaySound("bounceWall")
									sonido1 = true
								end
								Bone1.MoveToAbs(66 + 508/1.2*(SongTime - 50.4), 207 - 35/1.1*(SongTime - 50.5))
								if SongTime <= 51.1 then
									Bone2.MoveToAbs(66 + 508/1.2*(SongTime - 50.4), 207 - 94/0.6*(SongTime - 50.5))
								else
									if not sonido2 then
										Audio.PlaySound("bounceWall")
										sonido2 = true
									end
									Bone2.MoveToAbs(66 + 508/1.2*(SongTime - 50.4), 113 + 35/0.5*(SongTime - 51.1))
								end
							end
						else
							Bone1.MoveToAbs(574, 172)
							Bone2.MoveToAbs(574, 148)
							Audio.PlaySound("bouncePlat2")
							phases[1] = 34
						end
						if Bone1.absx >= 500 then
							PlatR.SetVar("AimY", math.min(math.max(Bone1.absy - 12, 130), 190))
						elseif Bone1.absx <= 140 then
							PlatL.SetVar("AimY", math.min(math.max(Bone1.absy, 130), 190))
						end
					end
				elseif phases[1] == 34 then
					if SongTime > 51.6 then
						if SongTime <= 52.8 then
							if SongTime <= 52.2 then
								Bone1.MoveToAbs(574 - 508/1.2*(SongTime - 51.6), 148 + 59/0.6*(SongTime - 51.6))
								Bone2.MoveToAbs(574 - 508/1.2*(SongTime - 51.6), 172 - 59/0.6*(SongTime - 51.6))
							else
								if not sonido3 then
									Audio.PlaySound("bounceWall2")
									sonido3 = true
								end
								Bone1.MoveToAbs(574 - 508/1.2*(SongTime - 51.6), 207 - 85/0.6*(SongTime - 52.2))
								Bone2.MoveToAbs(574 - 508/1.2*(SongTime - 51.6), 113 + 75/0.6*(SongTime - 52.2))
							end
						else
							Bone1.MoveToAbs(66, 122)
							Bone2.MoveToAbs(66, 188)
							Bone1.SetVar("Y", -math.random(3))
							Audio.PlaySound("bouncePlat")
							phases[1] = 35
						end
						if Bone1.absx >= 500 then
							PlatR.SetVar("AimY", math.min(math.max(Bone1.absy - 12, 130), 190))
						elseif Bone1.absx <= 140 then
							PlatL.SetVar("AimY", math.min(math.max(Bone1.absy, 130), 190))
						end
					end
				elseif phases[1] == 35 then
					if SongTime > 52.8 then
						if SongTime <= 54.01 then
							if 574 - 508/1.2*(SongTime - 51.6) > -10 then
								Bone2.MoveToAbs(574 - 508/1.2*(SongTime - 51.6), 113 + 75/0.6*(SongTime - 52.2))
							elseif Bone2 then
								Bone2.Remove()
								Bone2 = nil
								Audio.PlaySound("Congratulations")
								if not safe then
									for i=0,10 do
										local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
									end
								else
									for i=0,5 do
										local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
									end
								end
								Puntos.Sans = Puntos.Sans + 1
							end
							if Bone1.GetVar("Y") < 0 then
								Bone1.MoveToAbs(66 + 508/1.21*(SongTime - 52.8), math.max(Bone1.absy + Bone1.GetVar("Y"), 113))
								if Bone1.absy <= 113 then
									Bone1.SetVar("Y", -Bone1.GetVar("Y"))
									Audio.PlaySound("bounceWall")
								end
							else
								Bone1.MoveToAbs(66 + 508/1.21*(SongTime - 52.8), math.min(Bone1.absy + Bone1.GetVar("Y"), 207))
								if Bone1.absy >= 207 then
									Bone1.SetVar("Y", -Bone1.GetVar("Y"))
									Audio.PlaySound("bounceWall")
								end
							end
						else
							if Bone2 then
								Bone2.Remove()
								Bone2 = nil
								Audio.PlaySound("Congratulations")
								if not safe then
									for i=0,10 do
										local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
									end
								else
									for i=0,5 do
										local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
									end
								end
								Puntos.Sans = Puntos.Sans + 1
							end
							if Bone1.GetVar("Y") < 0 then
								Bone1.MoveToAbs(574, math.max(Bone1.absy + Bone1.GetVar("Y"), 113))
								Bone1.SetVar("Y", -math.random(3))
							else
								Bone1.MoveToAbs(574, math.min(Bone1.absy + Bone1.GetVar("Y"), 207))
								Bone1.SetVar("Y", math.random(3))
							end
							Audio.PlaySound("bouncePlat")
							phases[1] = 36
						end
						if Bone1.absx >= 500 then
							PlatR.SetVar("AimY", math.min(math.max(Bone1.absy, 130), 190))
						elseif Bone1.absx <= 140 then
							PlatL.SetVar("AimY", math.min(math.max(Bone1.absy, 130), 190))
						end
					end
				elseif phases[1] == 36 then
					if SongTime > 54.01 then
						if SongTime <= 55.22 then
							if Bone1.GetVar("Y") < 0 then
								Bone1.MoveToAbs(574 - 508/1.21*(SongTime - 54.01), math.max(Bone1.absy + Bone1.GetVar("Y"), 113))
								if Bone1.absy <= 113 then
									Bone1.SetVar("Y", -Bone1.GetVar("Y"))
									Audio.PlaySound("bounceWall")
								end
							else
								Bone1.MoveToAbs(574 - 508/1.21*(SongTime - 54.01), math.min(Bone1.absy + Bone1.GetVar("Y"), 207))
								if Bone1.absy >= 207 then
									Bone1.SetVar("Y", -Bone1.GetVar("Y"))
									Audio.PlaySound("bounceWall")
								end
							end
						else
							if Bone1.GetVar("Y") < 0 then
								Bone1.MoveToAbs(66, math.max(Bone1.absy + Bone1.GetVar("Y"), 113))
							else
								Bone1.MoveToAbs(66, math.min(Bone1.absy + Bone1.GetVar("Y"), 207))
							end
							Audio.PlaySound("ding")
							Audio.PlaySound("MultiBone")
							Audio.PlaySound("bouncePlat")
							BoneE = CreateSprite("Bullets/Bones/BoneP","Top")
							BoneE.MoveTo(66, Bone1.absy)
							Bone2 = CreateProjectileAbs("Bullets/Bones/BoneP", 66, Bone1.absy)
							Bone3 = CreateProjectileAbs("Bullets/Bones/BoneP", 66, Bone1.absy)
							Bone4 = CreateProjectileAbs("Bullets/Bones/BoneP", 66, Bone1.absy)
							Bone1.SetVar("PosY", Bone1.absy)
							Bone2.SetVar("PosY", Bone2.absy)
							Bone1.SetVar("DiffY", 113 - Bone1.GetVar("PosY"))
							Bone2.SetVar("DiffY", 207 - Bone2.GetVar("PosY"))
							if math.random(2) == 1 then
								Bone3.SetVar("Y", -math.random(3))
							else
								Bone3.SetVar("Y", math.random(3))
							end
							if math.random(2) == 1 then
								Bone4.SetVar("Y", -math.random(3))
							else
								Bone4.SetVar("Y", math.random(3))
							end
							focusL = 1
							focusR = 1
							phases[1] = 37
						end
						if Bone1.absx >= 500 then
							PlatR.SetVar("AimY", math.min(math.max(Bone1.absy, 130), 190))
						elseif Bone1.absx <= 140 then
							PlatL.SetVar("AimY", math.min(math.max(Bone1.absy, 130), 190))
						end
					end
				elseif phases[1] == 37 then
					if SongTime > 55.22 then
						if SongTime <= 59.2 then 
							if SongTime <= 56.55 then
								if SongTime <= 55.885 then
									Bone1.MoveToAbs(66 + 508/1.33*(SongTime - 55.22), Bone1.GetVar("PosY") + Bone1.GetVar("DiffY")/0.665*(SongTime - 55.22))
								else
									if not sonido4 then
										sonido4 = true
										Audio.PlaySound("bounceWall")
									end
									Bone1.MoveToAbs(66 + 508/1.33*(SongTime - 55.22), 113 + 63/0.665*(SongTime - 55.885))
								end
							elseif SongTime <= 57.3 then
								if focusR < 3 then
									focusR = 3
									Audio.PlaySound("bouncePlat2")
								end
								if SongTime <= 56.7375 then
									Bone1.MoveToAbs(574 - 508/0.75*(SongTime - 56.55), 176 + 31/0.1875*(SongTime - 56.55))
								else
									if not sonido5 then
										sonido5 = true
										Audio.PlaySound("bounceWall")
									end
									Bone1.MoveToAbs(574 - 508/0.75*(SongTime - 56.55), 207 - 88/0.5625*(SongTime - 56.7375))
								end
							elseif SongTime <= 58.2 then
								if focusL < 2 then
									focusL = 2
									Audio.PlaySound("bouncePlat2")
								end
								if SongTime <= 57.4 then
									Bone1.MoveToAbs(66 + 508/0.9*(SongTime - 57.3), 119 - 6/0.1*(SongTime - 57.3))
								else
									if not sonido6 then
										sonido6 = true
										Audio.PlaySound("bounceWall")
									end
									Bone1.MoveToAbs(66 + 508/0.9*(SongTime - 57.3), 113 + 88/0.8*(SongTime - 57.4))
								end
							elseif SongTime <= 59.16 then
								if focusR < 5 then
									focusR = 5
									Audio.PlaySound("bouncePlat2")
								end
								if SongTime <= 58.3 then
									Bone1.MoveToAbs(574 - 584/0.96*(SongTime - 58.2), 201 + 6/0.1*(SongTime - 58.2))
								else
									if not sonido7 then
										sonido7 = true
										Audio.PlaySound("bounceWall")
									end
									Bone1.MoveToAbs(574 - 584/0.96*(SongTime - 58.2), 207 - 90/0.86*(SongTime - 58.3))
								end
							elseif Bone1 then
								Bone1.Remove()
								Bone1 = nil
								Audio.PlaySound("Congratulations")
								if not safe then
									for i=0,10 do
										local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
									end
								else
									for i=0,5 do
										local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
									end
								end
								Puntos.Sans = Puntos.Sans + 1
							end
							if SongTime <= 56.55 then
								if SongTime <= 55.885 then
									Bone2.MoveToAbs(66 + 508/1.33*(SongTime - 55.22), Bone2.GetVar("PosY") + Bone2.GetVar("DiffY")/0.665*(SongTime - 55.22))
								else
									if not sonido8 then
										sonido8 = true
										Audio.PlaySound("bounceWall")
									end
									Bone2.MoveToAbs(66 + 508/1.33*(SongTime - 55.22), 207 - 63/0.665*(SongTime - 55.885))
								end
							elseif SongTime <= 58 then
								if SongTime <= 56.75 then
									Bone2.MoveToAbs(574 - 584/1.45*(SongTime - 56.55), 144 - 31/0.2*(SongTime - 56.55))
								else
									if not sonido9 then
										sonido9 = true
										Audio.PlaySound("bounceWall")
									end
									Bone2.MoveToAbs(574 - 584/1.45*(SongTime - 56.55), 113 + 88/1.25*(SongTime - 56.75))
								end
							elseif Bone2 then
								Bone2.Remove()
								Bone2 = nil
								Audio.PlaySound("Congratulations")
								if not safe then
									for i=0,10 do
										local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
									end
								else
									for i=0,5 do
										local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
									end
								end
								Puntos.Sans = Puntos.Sans + 1
							end
							if SongTime <= 56.4 then
								if Bone3.GetVar("Y") < 0 then
									Bone3.MoveToAbs(66 + 508/1.18*(SongTime - 55.22), math.max(Bone3.absy + Bone3.GetVar("Y"), 113))
									if Bone3.absy <= 113 then
										Bone3.SetVar("Y", -Bone3.GetVar("Y"))
										Audio.PlaySound("bounceWall")
									end
								else
									Bone3.MoveToAbs(66 + 508/1.18*(SongTime - 55.22), math.min(Bone3.absy + Bone3.GetVar("Y"), 207))
									if Bone3.absy >= 207 then
										Bone3.SetVar("Y", -Bone3.GetVar("Y"))
										Audio.PlaySound("bounceWall")
									end
								end
							elseif SongTime <= 57.3 then
								if not Bone3.GetVar("Derivada") then
									Bone3.SetVar("PosY", Bone3.absy)
									if Bone3.GetVar("Y") > 0 then
										Bone3.SetVar("DiffY", 207 - Bone3.GetVar("PosY"))
										Bone3.SetVar("Derivada", 1)
									else
										Bone3.SetVar("DiffY", 113 - Bone3.GetVar("PosY"))
										Bone3.SetVar("Derivada", 2)
									end
								end
								if focusR < 2 then
									focusR = 2
									Audio.PlaySound("bouncePlat")
								end
								if SongTime <= 56.85 then
									Bone3.MoveToAbs(574 - 508/0.9*(SongTime - 56.4), Bone3.GetVar("PosY") + Bone3.GetVar("DiffY")/0.45*(SongTime - 56.4))
								else
									if not sonido10 then
										sonido10 = true
										Audio.PlaySound("bounceWall")
									end
									if Bone3.GetVar("Derivada") == 1 then
										Bone3.MoveToAbs(574 - 508/0.9*(SongTime - 56.4), 207 - 60/0.45*(SongTime - 56.85))
									else
										Bone3.MoveToAbs(574 - 508/0.9*(SongTime - 56.4), 113 + 34/0.45*(SongTime - 56.85))
									end
								end
							elseif SongTime <= 58.2 then
								if Bone3.GetVar("Derivada") == 1 then
									if SongTime <= 57.6 then
										Bone3.MoveToAbs(66 + 508/0.9*(SongTime - 57.3), 147 - 34/0.3*(SongTime - 57.3))
									else
										if not sonido11 then
											sonido11 = true
											Audio.PlaySound("bounceWall")
										end
										Bone3.MoveToAbs(66 + 508/0.9*(SongTime - 57.3), 113 + 57/0.6*(SongTime - 57.6))
									end
								else
									Bone3.MoveToAbs(66 + 508/0.9*(SongTime - 57.3), 147 + 23/0.9*(SongTime - 57.3))
								end
							elseif SongTime <= 59.2 then
								if SongTime <= 58.5 then
									Bone3.MoveToAbs(574 - 584/1*(SongTime - 58.2), 170 + 37/0.3*(SongTime - 58.2))
								else
									if not sonido12 then
										sonido12 = true
										Audio.PlaySound("bounceWall")
									end
									Bone3.MoveToAbs(574 - 584/1*(SongTime - 58.2), 207 - 75/0.7*(SongTime - 58.5))
								end
							end
							if SongTime <= 56.7 then
								if Bone4.GetVar("Y") < 0 then
									Bone4.MoveToAbs(66 + 508/1.48*(SongTime - 55.22), math.max(Bone4.absy + Bone4.GetVar("Y"), 113))
									if Bone4.absy <= 113 then
										Bone4.SetVar("Y", -Bone4.GetVar("Y"))
										Audio.PlaySound("bounceWall")
									end
								else
									Bone4.MoveToAbs(66 + 508/1.48*(SongTime - 55.22), math.min(Bone4.absy + Bone4.GetVar("Y"), 207))
									if Bone4.absy >= 207 then
										Bone4.SetVar("Y", -Bone4.GetVar("Y"))
										Audio.PlaySound("bounceWall")
									end
								end
							elseif SongTime <= 58.1 then
								if focusR < 4 then
									focusR = 4
									Audio.PlaySound("bouncePlat")
								end
								if Bone4.GetVar("Y") < 0 then
									Bone4.MoveToAbs(574 - 508/1.4*(SongTime - 56.7), math.max(Bone4.absy + Bone4.GetVar("Y"), 113))
									if Bone4.absy <= 113 then
										Bone4.SetVar("Y", -Bone4.GetVar("Y"))
										Audio.PlaySound("bounceWall")
									end
								else
									Bone4.MoveToAbs(574 - 508/1.4*(SongTime - 56.7), math.min(Bone4.absy + Bone4.GetVar("Y"), 207))
									if Bone4.absy >= 207 then
										Bone4.SetVar("Y", -Bone4.GetVar("Y"))
										Audio.PlaySound("bounceWall")
									end
								end
							elseif SongTime <= 59.1 then
								if not Bone4.GetVar("Derivada") then
									Bone4.SetVar("PosY", Bone4.absy)
									if Bone4.GetVar("Y") > 0 then
										Bone4.SetVar("DiffY", 207 - Bone4.GetVar("PosY"))
										Bone4.SetVar("Derivada", 1)
									else
										Bone4.SetVar("DiffY", 137 - Bone4.GetVar("PosY"))
										Bone4.SetVar("Derivada", 2)
									end
								end
								if focusL < 3 then
									focusL = 3
									Audio.PlaySound("bouncePlat")
								end
								if Bone4.GetVar("Derivada") == 1 then
									if SongTime <= 58.5 then
										Bone4.MoveToAbs(66 + 584/1*(SongTime - 58.1), Bone4.GetVar("PosY") + Bone4.GetVar("DiffY")/0.4*(SongTime - 58.1))
									else
										if not sonido13 then
											sonido13 = true
											Audio.PlaySound("bounceWall")
										end
										Bone4.MoveToAbs(66 + 584/1*(SongTime - 58.1), 207 - 70/0.6*(SongTime - 58.5))
									end
								else
									Bone4.MoveToAbs(66 + 584/1*(SongTime - 58.1), Bone4.GetVar("PosY") + Bone4.GetVar("DiffY")/1*(SongTime - 58.1))
								end
							elseif Bone4 then
								Bone4.Remove()
								Bone4 = nil
								Audio.PlaySound("Congratulations")
								if not safe then
									for i=0,10 do
										local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 160, Y = 490 + math.random(50), PosX = 60 + 200/10*i, Color = colors[math.random(#colors)]})
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 160, Y = 490 + math.random(50), PosX = 60 + 200/10*i, Color = colors[math.random(#colors)]})
									end
								else
									for i=0,5 do
										local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 160, Y = 490 + math.random(50), PosX = 60 + 200/5*i, Color = colors[math.random(#colors)]})
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 160, Y = 490 + math.random(50), PosX = 60 + 200/5*i, Color = colors[math.random(#colors)]})
									end
								end
								Puntos.Papyrus = Puntos.Papyrus + 1
							end
						else
							if Bone1 then
								Bone1.Remove()
								Bone1 = nil
								Audio.PlaySound("Congratulations")
								if not safe then
									for i=0,10 do
										local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
									end
								else
									for i=0,5 do
										local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
									end
								end
								Puntos.Sans = Puntos.Sans + 1
							end
							if Bone2 then
								Bone2.Remove()
								Bone2 = nil
								Audio.PlaySound("Congratulations")
								if not safe then
									for i=0,10 do
										local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
									end
								else
									for i=0,5 do
										local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
									end
								end
								Puntos.Sans = Puntos.Sans + 1
							end
							Bone3.Remove()
							Bone3 = nil
							Audio.PlaySound("Congratulations")
							if not safe then
								for i=0,10 do
									local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
									table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
									table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
								end
							else
								for i=0,5 do
									local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
									table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
									table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
								end
							end
							Puntos.Sans = Puntos.Sans + 1
							if Bone4 then
								Bone4.Remove()
								Bone4 = nil
								Audio.PlaySound("Congratulations")
								if not safe then
									for i=0,10 do
										local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 160, Y = 490 + math.random(50), PosX = 60 + 200/10*i, Color = colors[math.random(#colors)]})
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 160, Y = 490 + math.random(50), PosX = 60 + 200/10*i, Color = colors[math.random(#colors)]})
									end
								else
									for i=0,5 do
										local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 160, Y = 490 + math.random(50), PosX = 60 + 200/5*i, Color = colors[math.random(#colors)]})
										table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 160, Y = 490 + math.random(50), PosX = 60 + 200/5*i, Color = colors[math.random(#colors)]})
									end
								end
								Puntos.Papyrus = Puntos.Papyrus + 1
							end
							if focusL < 3 then
								focusL = 3
							end
							if focusR < 5 then
								focusR = 5
							end
							phases[1] = 38
						end
						if (Bone1 and Bone1.absx >= 460) or (Bone3 and Bone3.absx >= 460) or (Bone4 and Bone4.absx >= 460) then
							if focusR == 1 then
								PlatR.SetVar("AimY", math.min(math.max(Bone3.absy, 130), 190))
							elseif focusR == 2 then
								PlatR.SetVar("AimY", math.min(math.max(Bone1.absy - 16, 130), 190))
							elseif focusR == 3 then
								PlatR.SetVar("AimY", math.min(math.max(Bone4.absy, 130), 190))
							elseif focusR == 4 then
								PlatR.SetVar("AimY", math.min(math.max(Bone1.absy, 130), 190))
							end
						elseif (Bone1 and Bone1.absx <= 180 and focusL == 1) or (Bone4 and Bone4.absx <= 140 and focusL == 2) then
							if focusL == 1 then
								PlatL.SetVar("AimY", math.min(math.max(Bone1.absy, 130), 190))
							elseif focusL == 2 then
								PlatL.SetVar("AimY", math.min(math.max(Bone4.absy, 130), 190))
							end
						end
						if focusL == 3 then
							PlatL.SetVar("AimY", 190)
						end
						if focusR == 5 then
							PlatR.SetVar("AimY", 190)
						end
					end
				elseif phases[1] == 38 then
					if SongTime > 59.2 then
						if not Bone1 and not spawned then
							Bone1 = CreateProjectileAbs("Bullets/Bones/BoneP", 650, 113)
							Audio.PlaySound("ding")
							spawned = true
						end
						if SongTime > 59.95 and SongTime <= 61.45 then
							if not Bone2 then
								Bone2 = CreateProjectileAbs("Bullets/Bones/BoneP", 650, 113)
								Audio.PlaySound("ding")
							end
							Bone2.MoveToAbs(650 - 660/1.5*(SongTime - 59.95), 113)
						elseif SongTime > 61.45 and Bone2 then
							Bone2.Remove()
							Bone2 = nil
							PapsSprite = "Angry"
							Audio.PlaySound("Congratulations")
							if not safe then
								for i=0,10 do
									local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
									table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
									table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
								end
							else
								for i=0,5 do
									local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
									table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
									table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
								end
							end
							Puntos.Sans = Puntos.Sans + 1
						end
						if SongTime <= 60.7 then
							Bone1.MoveToAbs(650 - 660/1.5*(SongTime - 59.2), 113)
						elseif Bone1 then
							Bone1.Remove()
							Bone1 = nil
							Audio.PlaySound("Congratulations")
							if not safe then
								for i=0,10 do
									local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
									table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
									table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
								end
							else
								for i=0,5 do
									local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
									table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
									table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
								end
							end
							Puntos.Sans = Puntos.Sans + 1
						end
						if SongTime > 60.7 and SongTime <= 62.2 then
							if not Bone3 then
								Bone3 = CreateProjectileAbs("Bullets/Bones/BoneP", 650, 113)
								Audio.PlaySound("ding")
							end
							Bone3.MoveToAbs(650 - 660/1.5*(SongTime - 60.7), 113)
						elseif SongTime > 62.2 and Bone3 then
							Bone3.Remove()
							Bone3 = nil
							Audio.PlaySound("Congratulations")
							if not safe then
								for i=0,10 do
									local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
									table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
									table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/10*i, Color = colors[math.random(#colors)]})
								end
							else
								for i=0,5 do
									local colors = {{1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0.5,0}, {1,0,0.5}, {0.5,0,1}, {0,0.5,1}, {1,1,1}}
									table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
									table.insert(Confetti, {Sprite = CreateSprite("Soul Shards/3","Top"), X = 490, Y = 490 + math.random(50), PosX = 390 + 200/5*i, Color = colors[math.random(#colors)]})
								end
							end
							Puntos.Sans = Puntos.Sans + 1
							phases[1] = 39
						end
					end
				elseif phases[1] == 39 then
					if SongTime > 63.7 then
						if GetAlMightyGlobal("Idioma") == "Spanish" then
							Bubble("[noskip][font:papyrus][voice:papyrus][waittall:0.5]Considero que\nesto es\nextremadamente\ninjusto.[w:1000000000] ", "rightwide", 320.5, 395, 40, 90, 1)
						else
							Bubble("[noskip][font:papyrus][voice:papyrus][waittall:0.5]I consider this\nto be extremelly\nunfair.[w:1000000000] ", "rightwide", 320.5, 395, 40, 90, 1)
						end
						PapsSprite = "Angry"
						phases[1] = 40
					end
				elseif phases[1] == 40 then
					if SongTime > 66.3 then
						if GetAlMightyGlobal("Idioma") == "Spanish" then
							Bubble("[noskip][font:papyrus][voice:papyrus][waittall:0.5]Deja de hacer\ntrampa ahora.[w:1000000000] ", "rightwide", 320.5, 395, 40, 90, 1)
						else
							Bubble("[noskip][font:papyrus][voice:papyrus][waittall:0.5]Stop cheating\nthis instant.[w:1000000000] ", "rightwide", 320.5, 395, 40, 90, 1)
						end
						phases[1] = 41
					end
				elseif phases[1] == 41 then
					if SongTime > 67.8 then
						if GetAlMightyGlobal("Idioma") == "Spanish" then
							Bubble("[noskip][font:sans][voice:sans][waittall:0.5]calma tu espina[w:2], hermano.[w:100000000] ", "leftwide", 310.5, 335, 10, 90, 1)
						else
							Bubble("[noskip][font:sans][voice:sans][waittall:0.5]chill your spine[w:2], bro.[w:100000000] ", "leftwide", 310.5, 335, 10, 90, 1)
						end
						phases[1] = 42
					end
				elseif phases[1] == 42 then
					if SongTime > 69.3 then
						if GetAlMightyGlobal("Idioma") == "Spanish" then
							Bubble("[noskip][font:papyrus][voice:papyrus][waittall:0.5]Relamente\nesperaba te\ntomaras esto en\nserio.[w:1000000000] ", "rightwide", 320.5, 395, 40, 90, 1)
						else
							Bubble("[noskip][font:papyrus][voice:papyrus][waittall:0.5]I really expected\nyou to take\nthis seriously.[w:1000000000] ", "rightwide", 320.5, 395, 40, 90, 1)
						end
						phases[1] = 43
					end
				elseif phases[1] == 43 then
					if SongTime > 71.4 then
						SansSolid = true
						if GetAlMightyGlobal("Idioma") == "Spanish" then
							Bubble("[noskip][font:sans][voice:sans][waittall:0.5]estoy totalmente serio\nahora.[w:100000000] ", "leftwide", 310.5, 335, 10, 90, 1)
						else
							Bubble("[noskip][font:sans][voice:sans][waittall:0.5]i'm totally serious now.[w:100000000] ", "leftwide", 310.5, 335, 10, 90, 1)
						end
						phases[1] = 44
					end
				elseif phases[1] == 44 then
					if SongTime > 74.4 then
						Arena.Resize(360, 130)
						state = 2
						SansSolid = nil
						Vanish = true
						if GetAlMightyGlobal("Idioma") == "Spanish" then
							Bubble("[noskip][font:papyrus][voice:papyrus][waittall:0.5]JUEGO TERMINADO[w:2],\nsans.[w:1000000000] ", "rightwide", 320.5, 395, 40, 90, 1)
						else
							Bubble("[noskip][font:papyrus][voice:papyrus][waittall:0.5]GAME OVER[w:2], sans.[w:1000000000] ", "rightwide", 320.5, 395, 40, 90, 1)
						end
						phases[1] = 45
					end
				elseif phases[1] == 45 then
					if SongTime > 76 then
						Bubble("[noskip][font:sans][voice:sans][waittall:0.5]ok.[w:100000000] ", "leftwide", 310.5, 335, 10, 90, 1)
						phases[1] = 46
					end
				elseif phases[1] == 46 then
					if SongTime > 77.4 then
						if GetAlMightyGlobal("Idioma") == "Spanish" then
							Bubble("[noskip][font:papyrus][voice:papyrus][waittall:0.5]Tenemos que\npelear con el\nhumano[w:2], verdad?[w:1000000000] ", "rightwide", 320.5, 395, 40, 90, 1)
						else
							Bubble("[noskip][font:papyrus][voice:papyrus][waittall:0.5]We need to\nfight the human[w:2],\nright?[w:1000000000] ", "rightwide", 320.5, 395, 40, 90, 1)
						end
						phases[1] = 47
					end
				elseif phases[1] == 47 then
					if SongTime > 79.9 then
						if GetAlMightyGlobal("Idioma") == "Spanish" then
							Bubble("[noskip][font:sans][voice:sans][waittall:0.5]tenemos?[w:100000000] ", "leftwide", 310.5, 335, 10, 90, 1)
						else
							Bubble("[noskip][font:sans][voice:sans][waittall:0.5]we do?[w:100000000] ", "leftwide", 310.5, 335, 10, 90, 1)
						end
						phases[1] = 48
					end
				elseif phases[1] == 48 then
					if SongTime > 80.8 then
						if GetAlMightyGlobal("Idioma") == "Spanish" then
							Bubble("[noskip][font:sans][voice:sans][waittall:0.5]bueno[w:2], siempre y cuando\nsea tu propia decisión.[w:100000000] ", "leftwide", 310.5, 335, 10, 90, 1)
						else
							Bubble("[noskip][font:sans][voice:sans][waittall:0.5]well[w:2], as long as it's\nyour own decision.[w:100000000] ", "leftwide", 310.5, 335, 10, 90, 1)
						end
						phases[1] = 49
					end
				elseif phases[1] == 49 then
					if SongTime > 84.15 then
						PapsSprite = "Dance"
						if GetAlMightyGlobal("Idioma") == "Spanish" then
							Bubble("[noskip][font:papyrus][voice:papyrus][waittall:0.5]OH POR FAVOR.[w:5]\nDónde está tu\nentusiasmo?[w:1000000000] ", "rightwide", 320.5, 395, 40, 90, 1)
						else
							Bubble("[noskip][font:papyrus][voice:papyrus][waittall:0.5]OH PLEASE.[w:5]\nWhere is your\nenthusiasm?[w:1000000000] ", "rightwide", 320.5, 395, 40, 90, 1)
						end
						phases[1] = 50
					end
				elseif phases[1] == 50 then
					if SongTime > 86.26 then
						if GetAlMightyGlobal("Idioma") == "Spanish" then
							Bubble("[noskip][font:papyrus][voice:papyrus][waittall:0.5][color:ff0000]Undyne[color:000000] ya habría\nmatado al humano\nahora.[w:1000000000] ", "rightwide", 320.5, 395, 40, 90, 1)
						else
							Bubble("[noskip][font:papyrus][voice:papyrus][waittall:0.5][color:ff0000]Undyne[color:000000] would\nhave killed the\nhuman by now.[w:1000000000] ", "rightwide", 320.5, 395, 40, 90, 1)
						end
						phases[1] = 51
					end
				elseif phases[1] == 51 then
					if SongTime > 88.95 then
						if GetAlMightyGlobal("Idioma") == "Spanish" then
							Bubble("[noskip][font:papyrus][voice:papyrus][waittall:0.5]Hey en realidad[w:2],\ndéjame probar\nalgo.[w:1000000000] ", "rightwide", 320.5, 395, 40, 90, 1)
						else
							Bubble("[noskip][font:papyrus][voice:papyrus][waittall:0.5]Hey actually[w:2],\nlet me give this\na shot.[w:1000000000] ", "rightwide", 320.5, 395, 40, 90, 1)
						end
						phases[1] = 52
					end
				elseif phases[1] == 52 then
					if SongTime > 92.4 then
						Bubble("", "", 0, 0, 0, 0, 1)
						phases[1] = 53
					end
				elseif phases[1] == 53 then
					if SongTime > 93.3 then
						Black = CreateSprite("Pixel", "Top")
						Black.color = {0,0,0}
						Black.Scale(640, 480)
						Black.MoveTo(320, 240)
						Heart2 = CreateSprite("Undertale/Game Over/Soul", "Top")
						Heart2.rotation = 180
						Heart2.Scale(0, 0)
						Heart2.MoveTo(320, 240)
						Papyrus.Remove()
						Papyrus = nil
						Sans2.Remove()
						Sans2 = nil
						Arena.Resize(130, 130)
						state = -1
						RecolorSoul()
						newpX = 320
						newpY = 160
						phases[1] = 54
					end
				elseif phases[1] >= 54 and phases[1] <= 75 then
					if SongTime > 93.3 + 0.05*(phases[1] - 54) then
						table.insert(Shards, {Sprite = CreateSprite("Soul Shards/"..math.random(4), "Top"), Time = 93.3 + 0.05*(phases[1] - 54), Follow = true})
						phases[1] = phases[1] + 1
					end
				elseif phases[1] == 76 then
					if SongTime > 94.7 then
						if SongTime <= 95.2 then
							Heart2.Scale(math.sin(math.rad(90/0.5*(SongTime - 94.7)))*1.5, math.sin(math.rad(90/0.5*(SongTime - 94.7)))*1.5)
						else
							Heart2.Scale(1.5, 1.5)
							phases[1] = 77
						end
					end
				elseif phases[1] == 77 then
					if SongTime > 95.5 then
						if SongTime <= 96 then
							Heart2.MoveTo(320, 360 - 120*math.cos(math.rad(90/0.5*(SongTime - 95.5))))
						else
							for i=1,#Shards do
								Shards[i - tableaux].Sprite.Remove()
								table.remove(Shards, i - tableaux)
								tableaux = tableaux + 1
							end
							tableaux = 0
							Heart2.Remove()
							Heart2 = nil
							Black.Remove()
							Black = nil
							for i=1,8 do
								table.insert(Shards, {Sprite = CreateSprite("Soul Shards/"..math.random(4), "Top"), Time = 96})
							end
							Effect = CreateSprite("Circle", "Top")
							Effect.Scale(0.5,0.5)
							Effect.MoveTo(320, 360)
							Audio.PlaySound("sparkle")
							Encounter.Call("SpawnUndyne")
							Paps.X = 240
							Sans.X = 410
							phases[1] = 78
						end
					end
				elseif phases[1] == 78 then
					if SongTime > 96 then
						if SongTime <= 96.5 then
							Paps.X = 240 - 80*math.sin(math.rad(90/0.5*(SongTime - 96)))
							Sans.X = 410 + 80*math.sin(math.rad(90/0.5*(SongTime - 96)))
						else
							Paps.X = 160
							Sans.X = 490
							if GetAlMightyGlobal("Idioma") == "Spanish" then
								Bubble("[noskip][voice:undyne][waittall:0.5]Ha pasado un tiempo[w:5],\npunk![w:1000000000] ", "rightwide", 490.5, 395, 40, 90, 1)
							else
								Bubble("[noskip][voice:undyne][waittall:0.5]It's been a while[w:5],\npunk![w:1000000000] ", "rightwide", 490.5, 395, 40, 90, 1)
							end
							phases[1] = 79
						end
					end
				elseif phases[1] == 79 then
					if SongTime > 98.4 then
						if GetAlMightyGlobal("Idioma") == "Spanish" then
							Bubble("[noskip][voice:undyne][waittall:0.5]Veamos que tienes\nesta vez.[w:1000000000] ", "rightwide", 490.5, 395, 40, 90, 1)
						else
							Bubble("[noskip][voice:undyne][waittall:0.5]Let's see what you\ngot this time.[w:1000000000] ", "rightwide", 490.5, 395, 40, 90, 1)
						end
						phases[1] = 80
					end
				elseif phases[1] == 80 then
					if SongTime > 100.8 then
						if GetAlMightyGlobal("Idioma") == "Spanish" then
							Bubble("[noskip][voice:undyne][waittall:0.5]De hecho[w:5], sería\nprobablemente mejor\ndejar que tengas tu\nturno primero.[w:1000000000] ", "rightwide", 490.5, 395, 40, 90, 1)
						else
							Bubble("[noskip][voice:undyne][waittall:0.5]Actually[w:5], it would\nprobably be better\nto let you have\nyour turn first.[w:1000000000] ", "rightwide", 490.5, 395, 40, 90, 1)
						end
						phases[1] = 81
					end
				end
				if phases[2] <= 6 then
					if SongTime > 13.875 + 0.075*phases[2] then
						if not Warn1 then
							Warn1 = CreateSprite("Pixel","BelowPlayer")
							Warn1.yscale = 36
							table.insert(Warns, Warn1)
						end
						if not Warn2 then
							Warn2 = CreateSprite("Pixel","BelowPlayer")
							Warn2.yscale = 36
							table.insert(Warns, Warn2)
						end
						Warn1.xscale = 12 + 10*phases[2]
						Warn2.xscale = 12 + 10*phases[2]
						Warn1.SetVar("X", 139 + Warn1.xscale/2)
						Warn1.SetVar("Y", 113)
						Warn2.SetVar("X", 501 - Warn2.xscale/2)
						Warn2.SetVar("Y", 207)
						if phases[2] >= 5 then
							table.insert(Bones2, {Bullet = CreateProjectileAbs("Bullets/Bones/BoneP", 145 + 10*(phases[2] - 5), 70), Move = 43, Appear = 13.875 + 0.075*phases[2], Disappear = 18.6})
							table.insert(Bones2, {Bullet = CreateProjectileAbs("Bullets/Bones/BoneP", 495 - 10*(phases[2] - 5), 250), Move = -43, Appear = 13.875 + 0.075*phases[2], Disappear = 18.6})
						end
						phases[2] = phases[2] + 1
					end
				elseif phases[2] > 6 and phases[2] <= 35 then
					if SongTime > 13.875 + 0.075*phases[2] then
						Warn1.xscale = 72
						Warn2.xscale = 72
						Warn1.SetVar("X", 175 + 10*(phases[2] - 7))
						Warn1.SetVar("Y", 113)
						Warn2.SetVar("X", 465 - 10*(phases[2] - 7))
						Warn2.SetVar("Y", 207)
						table.insert(Bones2, {Bullet = CreateProjectileAbs("Bullets/Bones/BoneP", 155 + 10*(phases[2] - 6), 70), Move = 43, Appear = 13.875 + 0.075*phases[2], Disappear = 18.6})
						table.insert(Bones2, {Bullet = CreateProjectileAbs("Bullets/Bones/BoneP", 485 - 10*(phases[2] - 6), 250), Move = -43, Appear = 13.875 + 0.075*phases[2], Disappear = 18.6})
						phases[2] = phases[2] + 1
					end
				elseif phases[2] > 35 and phases[2] <= 41 then
					if SongTime > 13.875 + 0.075*phases[2] then
						Warn1.xscale = 12 + 10*(41 - phases[2])
						Warn2.xscale = 12 + 10*(41 - phases[2])
						Warn1.SetVar("X", 499 - Warn1.xscale/2)
						Warn1.SetVar("Y", 113)
						Warn2.SetVar("X", 141 + Warn2.xscale/2)
						Warn2.SetVar("Y", 207)
						if phases[2] <= 40 then
							table.insert(Bones2, {Bullet = CreateProjectileAbs("Bullets/Bones/BoneP", 155 + 10*(phases[2] - 6), 70), Move = 43, Appear = 13.875 + 0.075*phases[2], Disappear = 18.6})
							table.insert(Bones2, {Bullet = CreateProjectileAbs("Bullets/Bones/BoneP", 485 - 10*(phases[2] - 6), 250), Move = -43, Appear = 13.875 + 0.075*phases[2], Disappear = 18.6})
						end
						phases[2] = phases[2] + 1
					end
				elseif phases[2] == 42 and SongTime > 13.875 + 0.075*phases[2] then
					Warn1.Remove()
					Warn2.Remove()
					Warn1 = nil
					Warn2 = nil
					phases[2] = 43
				elseif phases[2] == 43 and SongTime > 19.2 then
					table.insert(GB, {Sprite = CreateSprite("Bullets/GB Papyrus/0","BelowBullet"), Type = "Papyrus", Animacion = {DatosIniciales = {X = -50, Y = 530, rotation = 0}, DatosFinales = {X = 90, Y = 275, rotation = 45}, VelAppearing = 10}, Delay = 100, Duration = 30, LessFat = true})
					table.insert(GB, {Sprite = CreateSprite("Bullets/GB Sans/0","BelowBullet"), Type = "Sans", Animacion = {DatosIniciales = {X = 690, Y = 530, rotation = 0}, DatosFinales = {X = 550, Y = 275, rotation = -45}, VelAppearing = 10}, Delay = 100, Duration = 30, LessFat = true})
					Audio.PlaySound("gasterintro")
					Audio.PlaySound("gasterintro2")
					phases[2] = 44
				elseif phases[2] == 44 and SongTime > 19.45 then
					table.insert(GB, {Sprite = CreateSprite("Bullets/GB Papyrus/0","BelowBullet"), Type = "Papyrus", Animacion = {DatosIniciales = {X = -50, Y = 530, rotation = 0}, DatosFinales = {X = 70, Y = 190, rotation = 90}, VelAppearing = 10}, Delay = 100, Duration = 30, LessFat = true})
					table.insert(GB, {Sprite = CreateSprite("Bullets/GB Sans/0","BelowBullet"), Type = "Sans", Animacion = {DatosIniciales = {X = 690, Y = 530, rotation = 0}, DatosFinales = {X = 570, Y = 190, rotation = -90}, VelAppearing = 10}, Delay = 100, Duration = 30, LessFat = true})
					Audio.PlaySound("gasterintro")
					Audio.PlaySound("gasterintro2")
					phases[2] = 45
				elseif phases[2] == 45 and SongTime > 19.7 then
					table.insert(GB, {Sprite = CreateSprite("Bullets/GB Papyrus/0","BelowBullet"), Type = "Papyrus", Animacion = {DatosIniciales = {X = -50, Y = 530, rotation = 0}, DatosFinales = {X = 60, Y = 100, rotation = 90}, VelAppearing = 10}, Delay = 100, Duration = 30, LessFat = true})
					table.insert(GB, {Sprite = CreateSprite("Bullets/GB Sans/0","BelowBullet"), Type = "Sans", Animacion = {DatosIniciales = {X = 690, Y = 530, rotation = 0}, DatosFinales = {X = 580, Y = 100, rotation = -90}, VelAppearing = 10}, Delay = 100, Duration = 30, LessFat = true})
					Audio.PlaySound("gasterintro")
					Audio.PlaySound("gasterintro2")
					phases[2] = 46
				elseif phases[2] == 46 and SongTime > 19.95 then
					table.insert(GB, {Sprite = CreateSprite("Bullets/GB Papyrus/0","BelowBullet"), Type = "Papyrus", Animacion = {DatosIniciales = {X = -50, Y = 530, rotation = 0}, DatosFinales = {X = 180, Y = 300, rotation = 0}, VelAppearing = 10}, Delay = 100, Duration = 30, LessFat = true})
					table.insert(GB, {Sprite = CreateSprite("Bullets/GB Sans/0","BelowBullet"), Type = "Sans", Animacion = {DatosIniciales = {X = 690, Y = 530, rotation = 0}, DatosFinales = {X = 460, Y = 300, rotation = 0}, VelAppearing = 10}, Delay = 100, Duration = 30, LessFat = true})
					Audio.PlaySound("gasterintro")
					Audio.PlaySound("gasterintro2")
					phases[2] = 47
				elseif phases[2] == 47 and SongTime > 20.2 then
					table.insert(GB, {Sprite = CreateSprite("Bullets/GB Papyrus/0","BelowBullet"), Type = "Papyrus", Animacion = {DatosIniciales = {X = -50, Y = 530, rotation = 0}, DatosFinales = {X = 270, Y = 310, rotation = 0}, VelAppearing = 10}, Delay = 100, Duration = 30, LessFat = true})
					table.insert(GB, {Sprite = CreateSprite("Bullets/GB Sans/0","BelowBullet"), Type = "Sans", Animacion = {DatosIniciales = {X = 690, Y = 530, rotation = 0}, DatosFinales = {X = 370, Y = 310, rotation = 0}, VelAppearing = 10}, Delay = 100, Duration = 30, LessFat = true})
					Audio.PlaySound("gasterintro")
					Audio.PlaySound("gasterintro2")
					phases[2] = 48
				elseif phases[2] >= 48 and phases[2] <= 54 then
					if SongTime > 22.55 + 0.075*(phases[2] - 48) then
						if not Warn1 then
							Warn1 = CreateSprite("Pixel","BelowPlayer")
							Warn1.yscale = 36
							table.insert(Warns, Warn1)
						end
						if not Warn2 then
							Warn2 = CreateSprite("Pixel","BelowPlayer")
							Warn2.yscale = 36
							table.insert(Warns, Warn2)
						end
						Warn1.xscale = 12 + 10*(phases[2] - 48)
						Warn2.xscale = 12 + 10*(phases[2] - 48)
						Warn1.SetVar("X", 139 + Warn1.xscale/2)
						Warn1.SetVar("Y", 113)
						Warn2.SetVar("X", 501 - Warn2.xscale/2)
						Warn2.SetVar("Y", 113)
						if phases[2] >= 53 then
							table.insert(Bones2, {Bullet = CreateProjectileAbs("Bullets/Bones/BoneP", 145 + 10*(phases[2] - 53), 70), Move = 43, Appear = 22.55 + 0.075*(phases[2] - 48), Disappear = 24.03})
							table.insert(Bones2, {Bullet = CreateProjectileAbs("Bullets/Bones/BoneS", 495 - 10*(phases[2] - 53), 70), Move = 43, Appear = 22.55 + 0.075*(phases[2] - 48), Disappear = 24.03})
						end
						phases[2] = phases[2] + 1
					end
				elseif phases[2] > 54 and phases[2] <= 68 then
					if SongTime > 22.55 + 0.075*(phases[2] - 48) then
						Warn1.xscale = 72
						Warn2.xscale = 72
						Warn1.SetVar("X", 175 + 10*(phases[2] - 55))
						Warn1.SetVar("Y", 113)
						Warn2.SetVar("X", 465 - 10*(phases[2] - 55))
						Warn2.SetVar("Y", 113)
						table.insert(Bones2, {Bullet = CreateProjectileAbs("Bullets/Bones/BoneP", 155 + 10*(phases[2] - 54), 70), Move = 43, Appear = 22.55 + 0.075*(phases[2] - 48), Disappear = 24.03})
						table.insert(Bones2, {Bullet = CreateProjectileAbs("Bullets/Bones/BoneP", 485 - 10*(phases[2] - 54), 70), Move = 43, Appear = 22.55 + 0.075*(phases[2] - 48), Disappear = 24.03})
						phases[2] = phases[2] + 1
					end
				elseif phases[2] == 69 then
					Warn1.Remove()
					Warn2.Remove()
					Warn1 = nil
					Warn2 = nil
					phases[2] = 70
				end
			end
		elseif Encounter["GameMusic"] ~= "Wait 4" then
			if pudinTimer%90 == 0 then
				for i=0,1 do
					Plataforma = CreateProjectileAbs("Bullets/Platforms/70", 680 - 720*i, 137 + 48*i)
					Plataforma.SetVar("VelX", -2 + 4*i)
					Plataforma.SetVar("Plataforma", true)
					Plataforma.ppcollision = false
					table.insert(Platforms, Plataforma)
				end
			end
			if pudinTimer > 260 and pudinTimer%45 == 0 then
				if pudinTimer%90 == 0 then
					table.insert(GB, {Sprite = CreateSprite("Bullets/GB Sans/0","BelowBullet"), Scale = 0.5, Type = "Sans", Animacion = {DatosIniciales = {X = -50, Y = 530, rotation = 0}, DatosFinales = {X = 70, Y = 60 + 48*math.random(3), rotation = 90}}, Delay = 30, Duration = 24, NoShake = true})
				else
					table.insert(GB, {Sprite = CreateSprite("Bullets/GB Sans/0","BelowBullet"), Scale = 0.5, Type = "Sans", Animacion = {DatosIniciales = {X = 690, Y = 530, rotation = 0}, DatosFinales = {X = 570, Y = 60 + 48*math.random(3), rotation = -90}}, Delay = 30, Duration = 24, NoShake = true})
				end
				Audio.PlaySound("gasterintro")
			end
		end
		if Encounter["GameMusic"] == "Wait 4" then
			Paps.X = 160
			Sans.X = 490
			if phases[1] < 78 then
				Encounter.Call("SpawnUndyne")
			end
			for i=1,#GB do
				GB[i - tableaux].Sprite.Remove()
				table.remove(GB, i - tableaux)
				tableaux = tableaux + 1
			end
			tableaux = 0
			for i=1,#Shatter do
				Shatter[i - tableaux].Sprite.Remove()
				table.remove(Shatter, i - tableaux)
				tableaux = tableaux + 1
			end
			tableaux = 0
			for i=1,#Confetti do
				Confetti[i - tableaux].Sprite.Remove()
				table.remove(Confetti, i - tableaux)
				tableaux = tableaux + 1
			end
			tableaux = 0
			for i=1,#Warns do
				Warns[i - tableaux].Remove()
				table.remove(Warns, i - tableaux)
				tableaux = tableaux + 1
			end
			tableaux = 0
			for i=1,#Platforms do
				Platforms[i - tableaux].Remove()
				table.remove(Platforms, i - tableaux)
				tableaux = tableaux + 1
			end
			tableaux = 0
			if BoneE then
				BoneE.Remove()
			end
			if PlatE then
				PlatE.Remove()
			end
			if Heart then
				Heart.Remove()
			end
			if Heart2 then
				Heart2.Remove()
			end
			if Effect then
				Effect.Remove()
			end
			if PlatL then
				PlatL.Remove()
			end
			if PlatR then
				PlatR.Remove()
			end
			if Line then
				Line.Remove()
			end
			if PointsPaps then
				PointsPaps.Remove()
			end
			if PointsSans then
				PointsSans.Remove()
			end
			if Papyrus then
				Papyrus.Remove()
			end
			if Sans2 then
				Sans2.Remove()
			end
			if Black then
				Black.Remove()
			end
			Vanish = nil
			Bubble("", "", "", "", "", "", 1)
			Encounter["BackgroundAnimation"] = "Fade"
			Encounter["BGY"] = -300
			EndWave()
		end
	end
	if makedamage and phases[1] >= 27 then
		makedamage = nil
		if Player.hp > 20 then
			Player.Hurt(20)
		else
			finish = true
		end
	end
	if Effect then
		Effect.Scale(Effect.xscale + 0.02, Effect.yscale + 0.02)
		if Effect.alpha > 0 then
			Effect.alpha = Effect.alpha - 0.02
		else
			Effect.Remove()
			Effect = nil
		end
	end
	if Vanish then
		if PointsPaps then
			PointsPaps.alpha = PointsPaps.alpha - 0.03
			if PointsPaps.alpha <= 0 then
				PointsPaps.Remove()
				PointsPaps = nil
			end
		end
		if PointsSans then
			PointsSans.alpha = PointsSans.alpha - 0.03
			if PointsSans.alpha <= 0 then
				PointsSans.Remove()
				PointsSans = nil
			end
		end
		if Line then
			Line.alpha = Line.alpha - 0.03
			if Line.alpha <= 0 then
				Line.Remove()
				Line = nil
			end
		end
		if PlatL then
			PlatL.alpha = PlatL.alpha - 0.03
			if PlatL.alpha <= 0 then
				PlatL.Remove()
				PlatL = nil
			end
		end
		if PlatR then
			PlatR.alpha = PlatR.alpha - 0.03
			if PlatR.alpha <= 0 then
				PlatR.Remove()
				PlatR = nil
			end
		end
	end
	if PointsPaps then
		PointsPaps.Set("Numbers/"..Puntos.Papyrus)
	end
	if PointsSans then
		PointsSans.Set("Numbers/"..Puntos.Sans)
	end
	if maniac and Bubbles[1] and not Bubbles[1].Activo then
		if not first then
			Bubble("[noskip][font:papyrus][voice:papyrus][waittall:0.5]NYEH HEH HEH HEH\nHEH HEH HEH HEH\nHEH HEH HEH HEH\nHEH HEH HEH HEH[next] ", "rightwide", 490.5, 395, 40, 90, 1)
			first = true
		else
			Bubble("[noskip][font:papyrus][voice:papyrus][waittall:0.5]HEH HEH HEH HEH\nHEH HEH HEH HEH\nHEH HEH HEH HEH\nHEH HEH HEH HEH[next] ", "rightwide", 490.5, 395, 40, 90, 1)
		end
	end
	if Heart then
		Heart.Scale(Heart.xscale + 0.1, Heart.yscale + 0.1)
		Heart.alpha = Heart.alpha - 0.05
		if Heart.alpha <= 0 then
			Heart.Remove()
			Heart = nil
		end
	end
	if BoneE then
		BoneE.Scale(BoneE.xscale + 0.02, BoneE.yscale + 0.02)
		BoneE.alpha = BoneE.alpha - 0.05
		if BoneE.alpha <= 0 then
			BoneE.Remove()
			BoneE = nil
		end
	end
	if PlatE then
		PlatE.Scale(PlatE.xscale + 0.02, PlatE.yscale + 0.02)
		PlatE.alpha = PlatE.alpha - 0.05
		if PlatE.alpha <= 0 then
			PlatE.Remove()
			PlatE = nil
		end
	end
	if Papyrus and Sans2 then
		if SongTime%0.6 > 0 and SongTime%0.6 <= 0.3 then
			Papyrus.Set("Papyrus/"..PapsSprite.." 2")
			Sans2.Set("Sans/Dance 1")
		else
			Papyrus.Set("Papyrus/"..PapsSprite.." 1")
			Sans2.Set("Sans/Dance 2")
		end
		if SansSolid then
			Sans2.Set("Sans/Joke")
		end
	end
	shake = {}
	for i=1,#GB do
		local gb = GB[i - tableaux]
		if not gb.X then
			gb.X = gb.Sprite.x
		end
		if not gb.Y then
			gb.Y = gb.Sprite.y
		end
		if gb.Type == "Papyrus" then
			gb.distance = 26
		elseif gb.Type == "Sans" then
			gb.distance = 38
		end
		gb.Sprite.xscale = (gb.Scale or 1)
		if gb.Animacion then
			if not gb.Animacion.timer then
				gb.Animacion.timer = 0
			end
			gb.Animacion.timer = gb.Animacion.timer + 1
			gb.X = gb.Animacion.DatosIniciales.X + (gb.Animacion.DatosFinales.X - gb.Animacion.DatosIniciales.X)*math.sin(math.rad(gb.Animacion.timer*(90/(gb.Animacion.VelAppearing or 30))))
			gb.Y = gb.Animacion.DatosIniciales.Y + (gb.Animacion.DatosFinales.Y - gb.Animacion.DatosIniciales.Y)*math.sin(math.rad(gb.Animacion.timer*(90/(gb.Animacion.VelAppearing or 30))))
			gb.Sprite.MoveTo(gb.X, gb.Y)
			while gb.Animacion.DatosIniciales.rotation >= 360 or gb.Animacion.DatosIniciales.rotation < 0 do
				if gb.Animacion.DatosIniciales.rotation < 0 then
					gb.Animacion.DatosIniciales.rotation = gb.Animacion.DatosIniciales.rotation + 360
				else
					gb.Animacion.DatosIniciales.rotation = gb.Animacion.DatosIniciales.rotation - 360
				end
			end
			while gb.Animacion.DatosFinales.rotation >= 360 or gb.Animacion.DatosFinales.rotation < 0 do
				if gb.Animacion.DatosFinales.rotation < 0 then
					gb.Animacion.DatosFinales.rotation = gb.Animacion.DatosFinales.rotation + 360
				else
					gb.Animacion.DatosFinales.rotation = gb.Animacion.DatosFinales.rotation - 360
				end
			end
			if gb.Animacion.DatosFinales.rotation - gb.Animacion.DatosIniciales.rotation <= 180 and gb.Animacion.DatosFinales.rotation - gb.Animacion.DatosIniciales.rotation >= -180 then
				gb.Sprite.rotation = gb.Animacion.DatosIniciales.rotation - (gb.Animacion.DatosIniciales.rotation - gb.Animacion.DatosFinales.rotation)*math.sin(math.rad(gb.Animacion.timer*(90/(gb.Animacion.VelAppearing or 30))))
			else
				gb.Sprite.rotation = gb.Animacion.DatosIniciales.rotation - (360 - (gb.Animacion.DatosFinales.rotation - 180 + gb.Animacion.DatosIniciales.rotation - 180)*math.sin(math.rad(gb.Animacion.timer*(90/(gb.Animacion.VelAppearing or 30)))))
			end
			if gb.Animacion.timer >= (gb.Animacion.VelAppearing or 30) then
				gb.Animacion = nil
				gb.Done = true
			end
		else
			if gb.Rotation and not gb.Done then
				gb.Sprite.rotation = gb.Rotation
			end
			gb.Delay = gb.Delay - 1
		end
		if gb.Vel then
			gb.X = gb.X - gb.Vel*math.sin(math.rad(gb.Sprite.rotation))
			gb.Y = gb.Y + gb.Vel*math.cos(math.rad(gb.Sprite.rotation))
			gb.Vel = gb.Vel*1.1
			if gb.X < -100 or gb.X > 740 or gb.Y < -100 or gb.Y > 580 then
				gb.Vel = 0
			end
		end
		gb.Sprite.MoveTo(gb.X, gb.Y)
		if (gb.Delay < 0 and gb.Type == "Papyrus") or (gb.Delay < 6 and gb.Type == "Sans") then
			if gb.Delay == 5 then
				gb.Sprite.Set("Bullets/GB Sans/1")
			elseif gb.Delay == 3 then
				gb.Sprite.Set("Bullets/GB Sans/2")
			elseif gb.Delay == 1 then
				gb.Sprite.Set("Bullets/GB Sans/3")
			elseif gb.Delay == -1 then
				if gb.Type == "Papyrus" then
					gb.Sprite.Set("Bullets/GB Papyrus/1")
				else
					gb.Sprite.SetAnimation({"Bullets/GB Sans/4","Bullets/GB Sans/5"}, 0.04)
				end
				gb.Vel = 2
				Audio.PlaySound("gasterfire")
			elseif gb.Delay <= -2 then
				if gb.Duration > 0 then
					gb.Duration = gb.Duration - 1
					if not gb.Laser then
						gb.Laser = {Misil = CreateProjectileAbs("Bullets/GB Laser", gb.X + (640 + gb.distance*gb.Sprite.yscale)*math.sin(math.rad(gb.Sprite.rotation)), gb.Y - (640 + gb.distance*gb.Sprite.yscale)*math.cos(math.rad(gb.Sprite.rotation)))}
						gb.Laser.Misil.sprite.xscale = 0
						gb.Laser.Misil.sprite.rotation = gb.Sprite.rotation
						gb.Laser.Scale = 0
					else
						gb.Laser.Misil.MoveToAbs(gb.X + (640 + gb.distance*gb.Sprite.yscale)*math.sin(math.rad(gb.Sprite.rotation)), gb.Y - (640 + gb.distance*gb.Sprite.yscale)*math.cos(math.rad(gb.Sprite.rotation)))
						if gb.LessFat then
							if gb.Laser.Misil.sprite.xscale < 0.6*gb.Sprite.xscale and gb.Laser.Scale == 0 then
								gb.Laser.Misil.sprite.xscale = gb.Laser.Misil.sprite.xscale + 0.1*gb.Sprite.xscale
							else
								gb.Laser.Scale = gb.Laser.Scale + 50
								gb.Laser.Misil.sprite.xscale = 0.6*gb.Sprite.xscale + 0.1*gb.Sprite.xscale*math.sin(math.rad(gb.Laser.Scale))
							end
						else
							if gb.Laser.Misil.sprite.xscale < 0.9*gb.Sprite.xscale and gb.Laser.Scale == 0 then
								gb.Laser.Misil.sprite.xscale = gb.Laser.Misil.sprite.xscale + 0.1*gb.Sprite.xscale
							else
								gb.Laser.Scale = gb.Laser.Scale + 50
								gb.Laser.Misil.sprite.xscale = 0.9*gb.Sprite.xscale + 0.1*gb.Sprite.xscale*math.sin(math.rad(gb.Laser.Scale))
							end
						end
					end
					if not gb.NoShake and #shake <= 0 then
						shake = {math.random(-4, 4), math.random(-4, 4)}
					end
				else
					gb.Laser.Misil.SetVar("No Damage", true)
					if gb.Laser.Misil.sprite.xscale > 0 then
						gb.Laser.Misil.MoveToAbs(gb.X + (640 + gb.distance*gb.Sprite.yscale)*math.sin(math.rad(gb.Sprite.rotation)), gb.Y - (640 + gb.distance*gb.Sprite.yscale)*math.cos(math.rad(gb.Sprite.rotation)))
						gb.Laser.Misil.sprite.xscale = gb.Laser.Misil.sprite.xscale - 0.05*gb.Sprite.xscale
						gb.Laser.Misil.sprite.alpha = gb.Laser.Misil.sprite.xscale
					else
						gb.Laser.Misil.Remove()
						gb.Sprite.Remove()
						gb = nil
						table.remove(GB, i - tableaux)
						tableaux = tableaux + 1
					end
				end
			end
		end
		if gb and shake then
			gb.Sprite.MoveTo(gb.X + (shake[1] or 0), gb.Y + (shake[2] or 0))
			if gb.Laser then
				gb.Laser.Misil.Move((shake[1] or 0), (shake[2] or 0))
			end
		end
	end
	tableaux = 0
	Arena.MoveTo(320 + (shake[1] or 0), 90 + (shake[2] or 0), false, true)
	Encounter.Call("PapsMoveTo", {Paps.X + (shake[1] or 0), Paps.Y + (shake[2] or 0)})
	Encounter["Sans"]["Legs"].MoveTo(Sans.X + (shake[1] or 0), Sans.Y + (shake[2] or 0))
	Encounter.Call("StatusMoveTo", {320 + (shake[1] or 0), 70.5 + (shake[2] or 0)})
	Encounter.Call("ButtonMoveTo", {"Fight", 87 + (shake[1] or 0), 27 + (shake[2] or 0)})
	Encounter.Call("ButtonMoveTo", {"Act", 240 + (shake[1] or 0), 27 + (shake[2] or 0)})
	Encounter.Call("ButtonMoveTo", {"Item", 400 + (shake[1] or 0), 27 + (shake[2] or 0)})
	Encounter.Call("ButtonMoveTo", {"Mercy", 555 + (shake[1] or 0), 27 + (shake[2] or 0)})
	if BunchPaps then
		BunchPaps.Move((shake[1] or 0), (shake[2] or 0))
	end
	if BunchSans then
		BunchSans.Move((shake[1] or 0), (shake[2] or 0))
	end
	for i=1,#Shards do
		local Datos = Shards[i - tableaux]
		if not Datos.VelRotation then
			Datos.VelRotation = -9 + 6*math.random(2)
		end
		if not Datos.Rotation then
			Datos.Rotation = math.random(360)
		end
		if not Datos.Rot then
			Datos.Rot = math.random(360)
		end
		Datos.Rotation = Datos.Rotation + Datos.VelRotation
		Datos.Sprite.rotation = Datos.Rotation
		Datos.Sprite.Scale(1.5,1.5)
		if Datos.Follow then
			if SongTime <= Datos.Time + 1 then
				Datos.Sprite.MoveTo(Heart2.x + (400 - 400*math.sin(math.rad(90/1*(SongTime - Datos.Time))))*math.cos(math.rad(Datos.Rot)), Heart2.y + (400 - 400*math.sin(math.rad(90/1*(SongTime - Datos.Time))))*math.sin(math.rad(Datos.Rot)))
			else
				Datos.Sprite.Remove()
				table.remove(Shards, i - tableaux)
				tableaux = tableaux + 1
			end
		else
			if SongTime <= Datos.Time + 1 then
				Datos.Sprite.MoveTo(320 + 450/1*(SongTime - Datos.Time)*math.cos(math.rad(Datos.Rot)), 360 + 450/1*(SongTime - Datos.Time)*math.sin(math.rad(Datos.Rot)))
			else
				Datos.Sprite.Remove()
				table.remove(Shards, i - tableaux)
				tableaux = tableaux + 1
			end
		end
	end
	tableaux = 0
	for i=1,#Confetti do
		local Datos = Confetti[i - tableaux]
		if not Datos.Timer then
			Datos.Timer = 0
		end
		if not Datos.Rotation then
			Datos.Rotation = math.random(360)
		end
		if not Datos.VelRotation then
			Datos.VelRotation = -9 + 6*math.random(2)
		end
		Datos.Y = Datos.Y - 1.5
		if Datos.X < Datos.PosX then
			Datos.X = math.min(Datos.X + 2, Datos.PosX)
		elseif Datos.X > Datos.PosX then
			Datos.X = math.max(Datos.X - 2, Datos.PosX)
		else
			Datos.Timer = Datos.Timer + 2
		end
		Datos.Rotation = Datos.Rotation + Datos.VelRotation
		Datos.Sprite.rotation = Datos.Rotation
		Datos.Sprite.color = Datos.Color
		Datos.Sprite.MoveTo(Datos.X + 4*math.sin(math.rad(Datos.Timer)), Datos.Y)
		if Datos.Y <= 320 then
			Datos.Sprite.alpha = Datos.Sprite.alpha - 0.02
			if Datos.Sprite.alpha <= 0 then
				Datos.Sprite.Remove()
				table.remove(Confetti, i - tableaux)
				tableaux = tableaux + 1
			end
		end
	end
	tableaux = 0
	for i=1,#Shatter do
		local Datos = Shatter[i - tableaux]
		Datos.Sprite.rotation = Datos.Sprite.rotation + Datos.VelRot
		Datos.X = Datos.X - Datos.Vel
		Datos.Sprite.alpha = Datos.Sprite.alpha - 0.01
		Datos.Sprite.MoveTo(Datos.X, Datos.Y)
		if Datos.Sprite.alpha <= 0 then
			Datos.Sprite.Remove()
			table.remove(Shatter, i - tableaux)
			tableaux = tableaux + 1
		end
	end
	tableaux = 0
	for i=1,#Bones do
		local Datos = Bones[i - tableaux]
		if not Datos.X then
			Datos.X = Datos.Body.absx
		end
		if not Datos.Y then
			Datos.Y = Datos.Body.absy
		end
		Datos.X = Datos.X + Datos.Vel
		Datos.Body.sprite.yscale = Datos.Scale
		Datos.Legs.sprite.rotation = 180
		Datos.Body.MoveToAbs(Datos.X, Datos.Y)
		Datos.Head.MoveToAbs(Datos.X, Datos.Y + Datos.Scale/2 + 3)
		Datos.Legs.MoveToAbs(Datos.X, Datos.Y - Datos.Scale/2 - 3)
		if Datos.X <= Arena.x - Arena.width/2 - 2 or Datos.X >= Arena.x + Arena.width/2 + 2 then
			Datos.Body.Remove()
			Datos.Head.Remove()
			Datos.Legs.Remove()
			table.remove(Bones, i - tableaux)
			tableaux = tableaux + 1
		end
	end
	tableaux = 0
	for i=1,#Platforms do
		local bullet = Platforms[i - tableaux]
		if not bullet.GetVar("X") then
			bullet.SetVar("X", bullet.absx)
		end
		if not bullet.GetVar("Y") then
			bullet.SetVar("Y", bullet.absy)
		end
		bullet.SetVar("X", bullet.GetVar("X") + (bullet.GetVar("VelX") or 0))
		bullet.SetVar("Y", bullet.GetVar("Y") + (bullet.GetVar("VelY") or 0))
		bullet.MoveToAbs(bullet.GetVar("X") + (shake[1] or 0), bullet.GetVar("Y") + (shake[2] or 0))
		if bullet.GetVar("X") <= -40 or bullet.GetVar("X") >= 680 or bullet.GetVar("Y") <= -10 or bullet.GetVar("Y") >= 490 then
			bullet.Remove()
			table.remove(Platforms, i - tableaux)
			tableaux = tableaux + 1
		end
	end
	tableaux = 0
	for i=1,#Warns do
		local sprite = Warns[i - tableaux]
		if sprite.isactive then
			sprite.alpha = 0.2 + 0.1*math.sin(math.rad(1080*SongTime))
			sprite.MoveTo(sprite.GetVar("X") + (shake[1] or 0), sprite.GetVar("Y") + (shake[2] or 0))
		else
			table.remove(Warns, i - tableaux)
			tableaux = tableaux + 1
		end
	end
	tableaux = 0
	for i=1,#Bones2 do
		local Datos = Bones2[i - tableaux]
		if not Datos.X then
			Datos.X = Datos.Bullet.absx
		end
		if not Datos.Y then
			Datos.Y = Datos.Bullet.absy
			Datos.PosY = Datos.Y
		end
		if not Datos.Alpha then
			Datos.Alpha = 0
		end
		if SongTime > Datos.Appear then
			if SongTime <= Datos.Appear + 0.15 then
				Datos.Y = Datos.PosY + Datos.Move/0.15*(SongTime - Datos.Appear)
				Datos.Alpha = 1/0.15*(SongTime - Datos.Appear)
			elseif SongTime <= Datos.Disappear then
				Datos.Y = Datos.PosY + Datos.Move
				Datos.Alpha = 1
			elseif SongTime <= Datos.Disappear + 0.15 then
				Datos.Y = Datos.PosY + Datos.Move/0.15*(Datos.Disappear + 0.15 - SongTime)
				Datos.Alpha = 1/0.15*(Datos.Disappear + 0.15 - SongTime)
			end
		end
		Datos.Bullet.MoveToAbs(Datos.X + (shake[1] or 0), Datos.Y + (shake[2] or 0))
		Datos.Bullet.sprite.alpha = Datos.Alpha
		if SongTime > Datos.Disappear + 0.15 then
			Datos.Bullet.Remove()
			table.remove(Bones2, i - tableaux)
			tableaux = tableaux + 1
		end
	end
	tableaux = 0
	if state == -1 then
		if Input.Right > 0 then
			newpX = newpX + 2
		end
		if Input.Left > 0 then
			newpX = newpX - 2
		end
		if Input.Up > 0 then
			newpY = newpY + 2
		end
		if Input.Down > 0 then
			newpY = newpY - 2
		end
		if newpX < 328 - Arena.width/2 then
			newpX = 328 - Arena.width/2
		elseif newpX > 312 + Arena.width/2 then
			newpX = 312 + Arena.width/2
		end
		if newpY < 103 then
			newpY = 103
		elseif newpY > 87 + Arena.height then
			newpY = 87 + Arena.height
		end
		Player.MoveToAbs(newpX + (shake[1] or 0), newpY + (shake[2] or 0), true)
	elseif state == 0 then --Don't move
		Player.MoveToAbs(newpX + (shake[1] or 0), newpY + (shake[2] or 0), true)
	elseif state == 1 then -- Down
		if newpY > 85 + Arena.height and jump > 0 then
			newpY = 87 + Arena.height
			jump = 0
		elseif newpY < 105 then
			newpY = 103
			jump = 0
		elseif jump < 3 and jump > -3 then
			jump = jump - 0.5
		elseif jump < -3 and jump > -10 then
			jump = -10
		elseif jump < -3 then
			jump = jump - 1.5
		else
			jump = (jump/1.001) - 1
		end
		if Input.Up < 0 and jump > 3 then
			jump = 2
		end
		newpY = math.max(newpY + (jump/10), 103)
		if newpX < 328 - Arena.width/2 then
			newpX = 328 - Arena.width/2
		elseif newpX > 312 + Arena.width/2 then
			newpX = 312 + Arena.width/2
		end
		Player.MoveToAbs(newpX + (shake[1] or 0), newpY + (shake[2] or 0), true)
	elseif state == 2 then -- Down
		if Input.Right > 0 then
			newpX = newpX + 3
		end
		if Input.Left > 0 then
			newpX = newpX - 3
		end
		if newpY > 85 + Arena.height and jump > 0 then
			newpY = 87 + Arena.height
			jump = 0
		elseif OnPlatform then
			if Input.Up > 0 then
				jump = maxjump
			else
				newpX = newpX + VelX
				newpY = newpY + VelY
			end
			OnPlatform = nil
		elseif newpY < 105 then
			if Input.Up > 0 then
				jump = maxjump
			else
				newpY = 103
				jump = 0
			end
		elseif jump < 3 and jump > -3 then
			jump = jump - 0.5
		elseif jump < -3 and jump > -10 then
			jump = -10
		elseif jump < -3 then
			jump = jump - 1.5
		else
			jump = (jump/1.001) - 1
		end
		if Input.Up < 0 and jump > 3 then
			jump = 2
		end
		newpY = math.max(newpY + (jump/10), 103)
		if newpX < 328 - Arena.width/2 then
			newpX = 328 - Arena.width/2
		elseif newpX > 312 + Arena.width/2 then
			newpX = 312 + Arena.width/2
		end
		Player.MoveToAbs(newpX + (shake[1] or 0), newpY + (shake[2] or 0), true)
	elseif state == 3 then
		if Input.Up > 0 then
			newpY = newpY + 3
		end
		if Input.Down > 0 then
			newpY = newpY - 3
		end
		newpY = math.max(math.min(newpY, 217), 103)
		Player.MoveToAbs(newpX + (shake[1] or 0), newpY + (shake[2] or 0), true)
	elseif state == 4 then
		if Input.Up > 0 then
			newpY = newpY + 1.5
		end
		if Input.Down > 0 then
			newpY = newpY - 1.5
		end
		if bounce == "Up" then
			newpY = newpY + 3
		else
			newpY = newpY - 3
		end
		newpY = math.max(math.min(newpY, 217), 103)
		if newpY == 217 or newpY == 103 then
			if bounce == "Up" then
				bounce = "Down"
			else
				bounce = "Up"
			end
			Audio.PlaySound("bounceWall")
		end
		Player.MoveToAbs(newpX + (shake[1] or 0), newpY + (shake[2] or 0), true)
	elseif state == 5 then
		if Input.Up > 0 then
			newpY = newpY + 2
		end
		if Input.Down > 0 then
			newpY = newpY - 2
		end
		if bounce == "Up" then
			newpY = newpY + 4
		else
			newpY = newpY - 4
		end
		newpY = math.max(math.min(newpY, 217), 103)
		if newpY == 217 or newpY == 103 then
			if bounce == "Up" then
				bounce = "Down"
			else
				bounce = "Up"
			end
			Audio.PlaySound("bounceWall")
		end
		Player.MoveToAbs(newpX + (shake[1] or 0), newpY + (shake[2] or 0), true)
	elseif state == 6 then
		if Input.Up > 0 then
			newpY = newpY + 1
		end
		if Input.Down > 0 then
			newpY = newpY - 1
		end
		if bounce == "Up" then
			newpY = newpY + 2
		else
			newpY = newpY - 2
		end
		newpY = math.max(math.min(newpY, 217), 103)
		if newpY == 217 or newpY == 103 then
			if bounce == "Up" then
				bounce = "Down"
			else
				bounce = "Up"
			end
			Audio.PlaySound("bounceWall")
		end
		Player.MoveToAbs(newpX + (shake[1] or 0), newpY + (shake[2] or 0), true)
	elseif state == 7 then
		if Input.Up > 0 then
			newpY = newpY + 1
		end
		if Input.Down > 0 then
			newpY = newpY - 1
		end
		if bounce == "Up" then
			newpY = newpY + 2
		else
			newpY = newpY - 2
		end
		newpY = math.max(math.min(newpY, 217), 103)
		if newpY == 217 or newpY == 103 then
			if bounce == "Up" then
				bounce = "Down"
			else
				bounce = "Up"
			end
			Audio.PlaySound("bounceWall")
		end
		Player.MoveToAbs(newpX + (shake[1] or 0), newpY + (shake[2] or 0), true)
	elseif state == 8 then -- Down
		if Input.Right > 0 then
			newpX = newpX + 3
		end
		if Input.Left > 0 then
			newpX = newpX - 3
		end
		if newpY > 85 + Arena.height and jump > 0 then
			newpY = 87 + Arena.height
			jump = 0
		elseif OnPlatform then
			if Input.Up > 0 then
				jump = maxjump
			else
				newpX = newpX + VelX
				newpY = newpY + VelY
			end
			OnPlatform = nil
		elseif newpY < 105 then
			if Input.Up > 0 then
				jump = maxjump
			else
				newpY = 103
				jump = 0
			end
		elseif jump < 3 and jump > -3 then
			jump = jump - 0.5
		elseif jump < -3 and jump > -10 then
			jump = -10
		elseif jump < -3 then
			jump = jump - 1.5
		else
			jump = (jump/1.001) - 1
		end
		if Input.Up < 0 and jump > 3 then
			jump = 2
		end
		newpY = math.max(newpY + (jump/10), 103)
		if newpX < 328 - 210 then
			newpX = 328 - 210
		elseif newpX > 312 + 210 then
			newpX = 312 + 210
		end
		Player.MoveToAbs(newpX + (shake[1] or 0), newpY + (shake[2] or 0), true)
	end
	if PlatL then
		if PlatL.GetVar("AimY") == -1 then
			PlatL.MoveTo(60, math.max(PlatL.y - 3, 130))
			if PlatL.y <= 130 then
				PlatL.SetVar("AimY", -2)
			end
		elseif PlatL.GetVar("AimY") == -2 then
			PlatL.MoveTo(60, math.min(PlatL.y + 3, 190))
			if PlatL.y >= 190 then
				PlatL.SetVar("AimY", -1)
			end
		else
			if PlatL.y < PlatL.GetVar("AimY") then
				PlatL.MoveTo(60, math.min(PlatL.y + 3, PlatL.GetVar("AimY")))
			elseif PlatL.y > PlatL.GetVar("AimY") then
				PlatL.MoveTo(60, math.max(PlatL.y - 3, PlatL.GetVar("AimY")))
			end
		end
	end
	if PlatR then
		if PlatR.GetVar("AimY") == -1 then
			if PlatR.y < newpY then
				PlatR.MoveTo(580, math.min(PlatR.y + 3, math.min(newpY, 190)))
			elseif PlatR.y > newpY then
				PlatR.MoveTo(580, math.max(PlatR.y - 3, math.max(newpY, 130)))
			end
		else
			if PlatR.y < PlatR.GetVar("AimY") then
				PlatR.MoveTo(580, math.min(PlatR.y + 3, PlatR.GetVar("AimY")))
			elseif PlatR.y > PlatR.GetVar("AimY") then
				PlatR.MoveTo(580, math.max(PlatR.y - 3, PlatR.GetVar("AimY")))
			end
		end
	end
	if finish then
		EndEverything()
	end
end

function OnHit(bullet)
	if not bullet.GetVar("No Damage") and not bullet.GetVar("Plataforma") and not Player.isHurting then
		if Player.hp > 20 then
			Player.Hurt(20)
		else
			EndEverything()
		end
		Encounter["NOHIT"] = nil
	elseif bullet.GetVar("Plataforma") and jump <= 0 then
		if newpY >= bullet.GetVar("Y") + 4 + (shake[1] or 0) and newpY <= bullet.GetVar("Y") + 12 + (shake[2] or 0) then
			newpY = bullet.GetVar("Y") + 8
			jump = 0
			VelX = (bullet.GetVar("VelX") or 0)
			VelY = (bullet.GetVar("VelY") or 0)
			OnPlatform = true
		end
	end
end

function EndEverything()
	for i=1,#GB do
		GB[i - tableaux].Sprite.Remove()
		table.remove(GB, i - tableaux)
		tableaux = tableaux + 1
	end
	tableaux = 0
	for i=1,#Shatter do
		Shatter[i - tableaux].Sprite.Remove()
		table.remove(Shatter, i - tableaux)
		tableaux = tableaux + 1
	end
	tableaux = 0
	for i=1,#Confetti do
		Confetti[i - tableaux].Sprite.Remove()
		table.remove(Confetti, i - tableaux)
		tableaux = tableaux + 1
	end
	tableaux = 0
	for i=1,#Warns do
		Warns[i - tableaux].Remove()
		table.remove(Warns, i - tableaux)
		tableaux = tableaux + 1
	end
	tableaux = 0
	for i=1,#Platforms do
		Platforms[i - tableaux].Remove()
		table.remove(Platforms, i - tableaux)
		tableaux = tableaux + 1
	end
	tableaux = 0
	if BoneE then
		BoneE.Remove()
	end
	if PlatE then
		PlatE.Remove()
	end
	if Heart then
		Heart.Remove()
	end
	if Heart2 then
		Heart2.Remove()
	end
	if Effect then
		Effect.Remove()
	end
	if PlatL then
		PlatL.Remove()
	end
	if PlatR then
		PlatR.Remove()
	end
	if Line then
		Line.Remove()
	end
	if PointsPaps then
		PointsPaps.Remove()
	end
	if PointsSans then
		PointsSans.Remove()
	end
	if Papyrus then
		Papyrus.Remove()
	end
	if Sans2 then
		Sans2.Remove()
	end
	if Black then
		Black.Remove()
	end
	Vanish = nil
	Bubble("", "", "", "", "", "", 1)
	Encounter["X"] = Player.absx
	Encounter["Y"] = Player.absy
	Encounter["nextwaves"] = {"Game Over"}
	State("ACTIONSELECT")
	State("DEFENDING")
end